id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,500 | QoboLtd/cakephp-search | src/Utility/Validator.php | Validator.validateAggregator | protected static function validateAggregator(string $data): string
{
$options = array_keys(Options::getAggregators());
if (!in_array($data, $options)) {
$data = Options::DEFAULT_AGGREGATOR;
}
return $data;
} | php | protected static function validateAggregator(string $data): string
{
$options = array_keys(Options::getAggregators());
if (!in_array($data, $options)) {
$data = Options::DEFAULT_AGGREGATOR;
}
return $data;
} | [
"protected",
"static",
"function",
"validateAggregator",
"(",
"string",
"$",
"data",
")",
":",
"string",
"{",
"$",
"options",
"=",
"array_keys",
"(",
"Options",
"::",
"getAggregators",
"(",
")",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"data",
","... | Validate search aggregator.
@param string $data Aggregator value
@return string | [
"Validate",
"search",
"aggregator",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Validator.php#L166-L174 |
28,501 | BabDev/Transifex-API | src/ApiFactory.php | ApiFactory.createApiConnector | public function createApiConnector(string $name, array $options = []): ApiConnector
{
$namespace = __NAMESPACE__ . '\\Connector';
$class = $namespace . '\\' . \ucfirst(\strtolower($name));
if (\class_exists($class)) {
return new $class($this->client, $this->requestFactory, $... | php | public function createApiConnector(string $name, array $options = []): ApiConnector
{
$namespace = __NAMESPACE__ . '\\Connector';
$class = $namespace . '\\' . \ucfirst(\strtolower($name));
if (\class_exists($class)) {
return new $class($this->client, $this->requestFactory, $... | [
"public",
"function",
"createApiConnector",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ApiConnector",
"{",
"$",
"namespace",
"=",
"__NAMESPACE__",
".",
"'\\\\Connector'",
";",
"$",
"class",
"=",
"$",
"namespace",
".... | Factory method to create API connectors.
@param string $name Name of the API connector to retrieve
@param array $options API connector options
@return ApiConnector
@throws Exception\UnknownApiConnectorException | [
"Factory",
"method",
"to",
"create",
"API",
"connectors",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/ApiFactory.php#L71-L82 |
28,502 | QoboLtd/cakephp-search | src/Widgets/SavedSearchWidget.php | SavedSearchWidget.getResults | public function getResults(array $options = []) : ?SavedSearch
{
$this->setContainerId($options['entity']);
$table = TableRegistry::get('Search.SavedSearches');
/** @var \Search\Model\Entity\SavedSearch|null */
$savedSearch = $table->find()
->where(['id' => $this->widge... | php | public function getResults(array $options = []) : ?SavedSearch
{
$this->setContainerId($options['entity']);
$table = TableRegistry::get('Search.SavedSearches');
/** @var \Search\Model\Entity\SavedSearch|null */
$savedSearch = $table->find()
->where(['id' => $this->widge... | [
"public",
"function",
"getResults",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"?",
"SavedSearch",
"{",
"$",
"this",
"->",
"setContainerId",
"(",
"$",
"options",
"[",
"'entity'",
"]",
")",
";",
"$",
"table",
"=",
"TableRegistry",
"::",
"get... | Retrieve SavedSearch results for the widget
@param array $options containing entity and view params.
@return \Search\Model\Entity\SavedSearch|null | [
"Retrieve",
"SavedSearch",
"results",
"for",
"the",
"widget"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/SavedSearchWidget.php#L87-L126 |
28,503 | QoboLtd/cakephp-search | src/Widgets/SavedSearchWidget.php | SavedSearchWidget.setContainerId | public function setContainerId(EntityInterface $entity) : void
{
$this->containerId = self::TABLE_PREFIX . md5($entity->id);
} | php | public function setContainerId(EntityInterface $entity) : void
{
$this->containerId = self::TABLE_PREFIX . md5($entity->id);
} | [
"public",
"function",
"setContainerId",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"void",
"{",
"$",
"this",
"->",
"containerId",
"=",
"self",
"::",
"TABLE_PREFIX",
".",
"md5",
"(",
"$",
"entity",
"->",
"id",
")",
";",
"}"
] | setContainerId method.
Setting unique identifier of the widget.
@param \Cake\Datasource\EntityInterface $entity used for setting id of widget.
@return void | [
"setContainerId",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/SavedSearchWidget.php#L136-L139 |
28,504 | hiqdev/hipanel-module-finance | src/providers/BillTypesProvider.php | BillTypesProvider.getTypes | public function getTypes()
{
$options = ['select' => 'full', 'orderby' => 'name_asc', 'with_hierarchy' => true];
$types = Ref::findCached('type,bill', 'hipanel:finance', $options);
if (!$this->app->user->can('support')) {
$types = $this->removeUnusedTypes($types);
}
... | php | public function getTypes()
{
$options = ['select' => 'full', 'orderby' => 'name_asc', 'with_hierarchy' => true];
$types = Ref::findCached('type,bill', 'hipanel:finance', $options);
if (!$this->app->user->can('support')) {
$types = $this->removeUnusedTypes($types);
}
... | [
"public",
"function",
"getTypes",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"'select'",
"=>",
"'full'",
",",
"'orderby'",
"=>",
"'name_asc'",
",",
"'with_hierarchy'",
"=>",
"true",
"]",
";",
"$",
"types",
"=",
"Ref",
"::",
"findCached",
"(",
"'type,bill'",
... | Returns array of types.
When user can not support, filters out unused types.
@return Ref[] | [
"Returns",
"array",
"of",
"types",
".",
"When",
"user",
"can",
"not",
"support",
"filters",
"out",
"unused",
"types",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/providers/BillTypesProvider.php#L49-L59 |
28,505 | mmoreram/ControllerExtraBundle | Resolver/Paginator/PaginatorWheresEvaluator.php | PaginatorWheresEvaluator.addWildcards | private function addWildcards(
string $annotationWhereParameter,
string $whereValue
) : string {
if (substr($annotationWhereParameter, 0, 1) === '%') {
$whereValue = '%' . $whereValue;
}
if (substr($annotationWhereParameter, -1, 1) === '%') {
$whereVa... | php | private function addWildcards(
string $annotationWhereParameter,
string $whereValue
) : string {
if (substr($annotationWhereParameter, 0, 1) === '%') {
$whereValue = '%' . $whereValue;
}
if (substr($annotationWhereParameter, -1, 1) === '%') {
$whereVa... | [
"private",
"function",
"addWildcards",
"(",
"string",
"$",
"annotationWhereParameter",
",",
"string",
"$",
"whereValue",
")",
":",
"string",
"{",
"if",
"(",
"substr",
"(",
"$",
"annotationWhereParameter",
",",
"0",
",",
"1",
")",
"===",
"'%'",
")",
"{",
"$... | Add wildcards to query if necessary.
@param string $annotationWhereParameter
@param string $whereValue
@return string | [
"Add",
"wildcards",
"to",
"query",
"if",
"necessary",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/Paginator/PaginatorWheresEvaluator.php#L111-L124 |
28,506 | techdivision/import-category | src/Assembler/CategoryAttributeAssembler.php | CategoryAttributeAssembler.getCategoryAttributesByPrimaryKeyAndStoreIdExtendedWithAttributeCode | public function getCategoryAttributesByPrimaryKeyAndStoreIdExtendedWithAttributeCode($pk, $storeId)
{
// initialize the array for the attributes
$attributes = array();
// load the datetime attributes
foreach ($this->categoryDatetimeRepository->findAllByPrimaryKeyAndStoreIdExtendedW... | php | public function getCategoryAttributesByPrimaryKeyAndStoreIdExtendedWithAttributeCode($pk, $storeId)
{
// initialize the array for the attributes
$attributes = array();
// load the datetime attributes
foreach ($this->categoryDatetimeRepository->findAllByPrimaryKeyAndStoreIdExtendedW... | [
"public",
"function",
"getCategoryAttributesByPrimaryKeyAndStoreIdExtendedWithAttributeCode",
"(",
"$",
"pk",
",",
"$",
"storeId",
")",
"{",
"// initialize the array for the attributes",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"// load the datetime attributes",
"forea... | Intializes the existing attributes for the entity with the passed primary key, extended with their attribute code.
@param string $pk The primary key of the entity to load the attributes for
@param integer $storeId The ID of the store view to load the attributes for
@return array The entity attributes | [
"Intializes",
"the",
"existing",
"attributes",
"for",
"the",
"entity",
"with",
"the",
"passed",
"primary",
"key",
"extended",
"with",
"their",
"attribute",
"code",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Assembler/CategoryAttributeAssembler.php#L151-L184 |
28,507 | techdivision/import-category | src/Assembler/CategoryAssembler.php | CategoryAssembler.getCategoryByPkAndStoreId | public function getCategoryByPkAndStoreId($pk, $storeId)
{
// load the category with the passed path
if ($category = $this->categoryRepository->load($pk)) {
// load the category's attribute values for the passed PK and store ID
$attributes = $this->categoryAttributeAssembler... | php | public function getCategoryByPkAndStoreId($pk, $storeId)
{
// load the category with the passed path
if ($category = $this->categoryRepository->load($pk)) {
// load the category's attribute values for the passed PK and store ID
$attributes = $this->categoryAttributeAssembler... | [
"public",
"function",
"getCategoryByPkAndStoreId",
"(",
"$",
"pk",
",",
"$",
"storeId",
")",
"{",
"// load the category with the passed path",
"if",
"(",
"$",
"category",
"=",
"$",
"this",
"->",
"categoryRepository",
"->",
"load",
"(",
"$",
"pk",
")",
")",
"{"... | Returns the category with the passed primary key and the attribute values for the passed store ID.
@param string $pk The primary key of the category to return
@param integer $storeId The store ID of the category values
@return array|null The category data | [
"Returns",
"the",
"category",
"with",
"the",
"passed",
"primary",
"key",
"and",
"the",
"attribute",
"values",
"for",
"the",
"passed",
"store",
"ID",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Assembler/CategoryAssembler.php#L74-L90 |
28,508 | QoboLtd/cakephp-search | src/Widgets/ReportWidget.php | ReportWidget.getReports | public function getReports() : array
{
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS());
EventManager::instance()->dispatch($event);
return (array)$event->getResult();
} | php | public function getReports() : array
{
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS());
EventManager::instance()->dispatch($event);
return (array)$event->getResult();
} | [
"public",
"function",
"getReports",
"(",
")",
":",
"array",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"(",
"string",
")",
"EventName",
"::",
"MODEL_DASHBOARDS_GET_REPORTS",
"(",
")",
")",
";",
"EventManager",
"::",
"instance",
"(",
")",
"->",
"dispatch"... | Method retrieves all reports from ini files
Basic reports getter that uses Events
to get reports application-wise.
@return mixed[] $result with reports array. | [
"Method",
"retrieves",
"all",
"reports",
"from",
"ini",
"files"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/ReportWidget.php#L120-L126 |
28,509 | QoboLtd/cakephp-search | src/Widgets/ReportWidget.php | ReportWidget.getReport | public function getReport(array $options = []) : array
{
if (empty($options['entity'])) {
return [];
}
if (empty($options['reports'])) {
$options['reports'] = $this->getReports();
}
$widgetId = $options['entity']->widget_id;
if (empty($optio... | php | public function getReport(array $options = []) : array
{
if (empty($options['entity'])) {
return [];
}
if (empty($options['reports'])) {
$options['reports'] = $this->getReports();
}
$widgetId = $options['entity']->widget_id;
if (empty($optio... | [
"public",
"function",
"getReport",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'entity'",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"o... | Parses the config of the report for widgetHandler
@param mixed[] $options with entity data.
@return mixed[] | [
"Parses",
"the",
"config",
"of",
"the",
"report",
"for",
"widgetHandler"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/ReportWidget.php#L134-L162 |
28,510 | QoboLtd/cakephp-search | src/Widgets/ReportWidget.php | ReportWidget.getReportInstance | public function getReportInstance(array $options = []) : ?ReportGraphsInterface
{
if (empty($options['config'])) {
$options['config'] = $this->getReport($options);
}
if (empty($options['config'])) {
return null;
}
$renderAs = $options['config']['info... | php | public function getReportInstance(array $options = []) : ?ReportGraphsInterface
{
if (empty($options['config'])) {
$options['config'] = $this->getReport($options);
}
if (empty($options['config'])) {
return null;
}
$renderAs = $options['config']['info... | [
"public",
"function",
"getReportInstance",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"?",
"ReportGraphsInterface",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'config'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'config'",
"]",
"="... | Initialize Report instance
ReportWidgetHandler operates via $_instance variable
that we set based on the renderAs parameter of the report.
@param mixed[] $options containing reports
@return \Search\Widgets\Reports\ReportGraphsInterface|null | [
"Initialize",
"Report",
"instance"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/ReportWidget.php#L173-L198 |
28,511 | QoboLtd/cakephp-search | src/Widgets/ReportWidget.php | ReportWidget.getResults | public function getResults(array $options = []) : array
{
$this->_instance = $this->getReportInstance($options);
if (null === $this->_instance) {
return [];
}
$config = $this->getReport($options);
if (empty($config)) {
return [];
}
$t... | php | public function getResults(array $options = []) : array
{
$this->_instance = $this->getReportInstance($options);
if (null === $this->_instance) {
return [];
}
$config = $this->getReport($options);
if (empty($config)) {
return [];
}
$t... | [
"public",
"function",
"getResults",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"this",
"->",
"_instance",
"=",
"$",
"this",
"->",
"getReportInstance",
"(",
"$",
"options",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this"... | Assembles results data for the report
Establish report data for the widgetHandler.
@param mixed[] $options with entity and view data.
@throws \RuntimeException
@return mixed[] $result containing $_data. | [
"Assembles",
"results",
"data",
"for",
"the",
"report"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/ReportWidget.php#L209-L238 |
28,512 | QoboLtd/cakephp-search | src/Widgets/ReportWidget.php | ReportWidget.getQueryData | public function getQueryData(array $config = []) : array
{
if (empty($config)) {
return [];
}
$resultSet = [];
if (!empty($config['info']['finder'])) {
$table = $config['info']['model'];
$finder = $config['info']['finder']['name'];
$... | php | public function getQueryData(array $config = []) : array
{
if (empty($config)) {
return [];
}
$resultSet = [];
if (!empty($config['info']['finder'])) {
$table = $config['info']['model'];
$finder = $config['info']['finder']['name'];
$... | [
"public",
"function",
"getQueryData",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"config",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"resultSet",
"=",
"[",
"]",
";",
"if",
"(",
"!",... | Retrieve Query data for the report
Executes Query statement from the report.ini
to retrieve actual report resultSet.
@param mixed[] $config of the report.ini
@return mixed[] $result containing required resultset fields. | [
"Retrieve",
"Query",
"data",
"for",
"the",
"report"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/ReportWidget.php#L249-L286 |
28,513 | TYPO3-CMS/redirects | Classes/Service/RedirectService.php | RedirectService.resolveLinkDetailsFromLinkTarget | protected function resolveLinkDetailsFromLinkTarget(string $redirectTarget): array
{
// build the target URL, take force SSL into account etc.
$linkService = GeneralUtility::makeInstance(LinkService::class);
try {
$linkDetails = $linkService->resolve($redirectTarget);
... | php | protected function resolveLinkDetailsFromLinkTarget(string $redirectTarget): array
{
// build the target URL, take force SSL into account etc.
$linkService = GeneralUtility::makeInstance(LinkService::class);
try {
$linkDetails = $linkService->resolve($redirectTarget);
... | [
"protected",
"function",
"resolveLinkDetailsFromLinkTarget",
"(",
"string",
"$",
"redirectTarget",
")",
":",
"array",
"{",
"// build the target URL, take force SSL into account etc.",
"$",
"linkService",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"LinkService",
"::",
... | Check if the current request is actually a redirect, and then process the redirect.
@param string $redirectTarget
@return array the link details from the linkService | [
"Check",
"if",
"the",
"current",
"request",
"is",
"actually",
"a",
"redirect",
"and",
"then",
"process",
"the",
"redirect",
"."
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Service/RedirectService.php#L131-L163 |
28,514 | TYPO3-CMS/redirects | Classes/Service/RedirectService.php | RedirectService.addQueryParams | protected function addQueryParams(array $queryParams, Uri $url): Uri
{
// New query parameters overrule the ones that should be kept
$newQueryParamString = $url->getQuery();
if (!empty($newQueryParamString)) {
$newQueryParams = [];
parse_str($newQueryParamString, $new... | php | protected function addQueryParams(array $queryParams, Uri $url): Uri
{
// New query parameters overrule the ones that should be kept
$newQueryParamString = $url->getQuery();
if (!empty($newQueryParamString)) {
$newQueryParams = [];
parse_str($newQueryParamString, $new... | [
"protected",
"function",
"addQueryParams",
"(",
"array",
"$",
"queryParams",
",",
"Uri",
"$",
"url",
")",
":",
"Uri",
"{",
"// New query parameters overrule the ones that should be kept",
"$",
"newQueryParamString",
"=",
"$",
"url",
"->",
"getQuery",
"(",
")",
";",
... | Adds query parameters to a Uri object
@param array $queryParams
@param Uri $url
@return Uri | [
"Adds",
"query",
"parameters",
"to",
"a",
"Uri",
"object"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Service/RedirectService.php#L200-L214 |
28,515 | TYPO3-CMS/redirects | Classes/Service/RedirectService.php | RedirectService.bootFrontendController | protected function bootFrontendController(?SiteInterface $site, array $queryParams): TypoScriptFrontendController
{
// disable page errors
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling'] = false;
$controller = GeneralUtility::makeInstance(
TypoScriptFrontendControll... | php | protected function bootFrontendController(?SiteInterface $site, array $queryParams): TypoScriptFrontendController
{
// disable page errors
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling'] = false;
$controller = GeneralUtility::makeInstance(
TypoScriptFrontendControll... | [
"protected",
"function",
"bootFrontendController",
"(",
"?",
"SiteInterface",
"$",
"site",
",",
"array",
"$",
"queryParams",
")",
":",
"TypoScriptFrontendController",
"{",
"// disable page errors",
"$",
"GLOBALS",
"[",
"'TYPO3_CONF_VARS'",
"]",
"[",
"'FE'",
"]",
"["... | Finishing booting up TSFE, after that the following properties are available.
Instantiating is done by the middleware stack (see Configuration/RequestMiddlewares.php)
- TSFE->fe_user
- TSFE->sys_page
- TSFE->tmpl
- TSFE->config
- TSFE->cObj
So a link to a page can be generated.
@param SiteInterface|null $site
@para... | [
"Finishing",
"booting",
"up",
"TSFE",
"after",
"that",
"the",
"following",
"properties",
"are",
"available",
"."
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Service/RedirectService.php#L272-L290 |
28,516 | hiqdev/hipanel-module-finance | src/forms/AbstractTariffForm.php | AbstractTariffForm.setDefaultTariff | protected function setDefaultTariff()
{
if (!$this->setTariff($this->parentTariff)) {
return false;
}
// Default tariff's id and name are useless on create
$this->id = null;
$this->name = null;
return true;
} | php | protected function setDefaultTariff()
{
if (!$this->setTariff($this->parentTariff)) {
return false;
}
// Default tariff's id and name are useless on create
$this->id = null;
$this->name = null;
return true;
} | [
"protected",
"function",
"setDefaultTariff",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"setTariff",
"(",
"$",
"this",
"->",
"parentTariff",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Default tariff's id and name are useless on create",
"$",
"this",
... | Sets default tariff.
@return bool success | [
"Sets",
"default",
"tariff",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/forms/AbstractTariffForm.php#L96-L107 |
28,517 | QoboLtd/cakephp-search | src/Shell/SearchShell.php | SearchShell.cleanup | public function cleanup(string $time = self::DEFAULT_MAX_LENGTH) : void
{
$table = $this->loadModel('Search.SavedSearches');
$date = strtotime($time);
if (false === $date) {
$this->err(sprintf('Failed to remove pre-saved searches, unsupported time value provided: %s', $time));
... | php | public function cleanup(string $time = self::DEFAULT_MAX_LENGTH) : void
{
$table = $this->loadModel('Search.SavedSearches');
$date = strtotime($time);
if (false === $date) {
$this->err(sprintf('Failed to remove pre-saved searches, unsupported time value provided: %s', $time));
... | [
"public",
"function",
"cleanup",
"(",
"string",
"$",
"time",
"=",
"self",
"::",
"DEFAULT_MAX_LENGTH",
")",
":",
"void",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"loadModel",
"(",
"'Search.SavedSearches'",
")",
";",
"$",
"date",
"=",
"strtotime",
"(",
"... | Method responsible for outdated pre-saved searches cleanup.
@param string $time A date/time string. Valid formats are explained in http://php.net/manual/en/datetime.formats.php
@return void | [
"Method",
"responsible",
"for",
"outdated",
"pre",
"-",
"saved",
"searches",
"cleanup",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Shell/SearchShell.php#L43-L61 |
28,518 | hiqdev/hipanel-module-finance | src/models/Price.php | Price.getUnitOptions | public function getUnitOptions()
{
$unitGroup = [
'speed' => ['bps', 'kbps', 'mbps', 'gbps', 'tbps'],
'size' => ['mb', 'mb10', 'mb100', 'gb', 'tb'],
];
$availableUnitsByPriceType = [
'overuse,ip_num' => ['items'],
'overuse,support_time' => ['h... | php | public function getUnitOptions()
{
$unitGroup = [
'speed' => ['bps', 'kbps', 'mbps', 'gbps', 'tbps'],
'size' => ['mb', 'mb10', 'mb100', 'gb', 'tb'],
];
$availableUnitsByPriceType = [
'overuse,ip_num' => ['items'],
'overuse,support_time' => ['h... | [
"public",
"function",
"getUnitOptions",
"(",
")",
"{",
"$",
"unitGroup",
"=",
"[",
"'speed'",
"=>",
"[",
"'bps'",
",",
"'kbps'",
",",
"'mbps'",
",",
"'gbps'",
",",
"'tbps'",
"]",
",",
"'size'",
"=>",
"[",
"'mb'",
",",
"'mb10'",
",",
"'mb100'",
",",
"... | Returns array of unit option, that are available for this price
depending on price type.
@return array | [
"Returns",
"array",
"of",
"unit",
"option",
"that",
"are",
"available",
"for",
"this",
"price",
"depending",
"on",
"price",
"type",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/models/Price.php#L94-L130 |
28,519 | hiqdev/hipanel-module-finance | src/models/Price.php | Price.isQuantityPredefined | public function isQuantityPredefined(): bool
{
if (!$this->isOveruse()
&& ($this->isShared() || $this->getSubtype() === 'rack_unit')
) {
return false;
}
return true;
} | php | public function isQuantityPredefined(): bool
{
if (!$this->isOveruse()
&& ($this->isShared() || $this->getSubtype() === 'rack_unit')
) {
return false;
}
return true;
} | [
"public",
"function",
"isQuantityPredefined",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isOveruse",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"isShared",
"(",
")",
"||",
"$",
"this",
"->",
"getSubtype",
"(",
")",
"===",
"'rack_uni... | Method checks, whether current price quantity is predefined and is not a result
of sophisticated calculation on server side.
@return bool | [
"Method",
"checks",
"whether",
"current",
"price",
"quantity",
"is",
"predefined",
"and",
"is",
"not",
"a",
"result",
"of",
"sophisticated",
"calculation",
"on",
"server",
"side",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/models/Price.php#L137-L146 |
28,520 | techdivision/import-category | src/Observers/UrlRewriteUpdateObserver.php | UrlRewriteUpdateObserver.initializeUrlRewrite | protected function initializeUrlRewrite(array $attr)
{
// load store ID and request path
$categoryId = $attr[MemberNames::ENTITY_ID];
$requestPath = $attr[MemberNames::REQUEST_PATH];
// iterate over the available URL rewrites to find the one that matches the category ID
for... | php | protected function initializeUrlRewrite(array $attr)
{
// load store ID and request path
$categoryId = $attr[MemberNames::ENTITY_ID];
$requestPath = $attr[MemberNames::REQUEST_PATH];
// iterate over the available URL rewrites to find the one that matches the category ID
for... | [
"protected",
"function",
"initializeUrlRewrite",
"(",
"array",
"$",
"attr",
")",
"{",
"// load store ID and request path",
"$",
"categoryId",
"=",
"$",
"attr",
"[",
"MemberNames",
"::",
"ENTITY_ID",
"]",
";",
"$",
"requestPath",
"=",
"$",
"attr",
"[",
"MemberNam... | Initialize the URL rewrite with the passed attributes and returns an instance.
@param array $attr The URL rewrite attributes
@return array The initialized URL rewrite | [
"Initialize",
"the",
"URL",
"rewrite",
"with",
"the",
"passed",
"attributes",
"and",
"returns",
"an",
"instance",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Observers/UrlRewriteUpdateObserver.php#L183-L212 |
28,521 | hiqdev/hipanel-module-finance | src/widgets/PayButtonComment.php | PayButtonComment.renderComment | protected function renderComment()
{
$merchant = $this->getMerchantName();
if (($view = $this->getCommentView($merchant)) === null) {
return '';
}
return $this->render($view, [
'merchant' => $merchant,
'widget' => $this,
'event' => $t... | php | protected function renderComment()
{
$merchant = $this->getMerchantName();
if (($view = $this->getCommentView($merchant)) === null) {
return '';
}
return $this->render($view, [
'merchant' => $merchant,
'widget' => $this,
'event' => $t... | [
"protected",
"function",
"renderComment",
"(",
")",
"{",
"$",
"merchant",
"=",
"$",
"this",
"->",
"getMerchantName",
"(",
")",
";",
"if",
"(",
"(",
"$",
"view",
"=",
"$",
"this",
"->",
"getCommentView",
"(",
"$",
"merchant",
")",
")",
"===",
"null",
... | Method renders comment from the view, specified in.
@return string | [
"Method",
"renders",
"comment",
"from",
"the",
"view",
"specified",
"in",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/widgets/PayButtonComment.php#L92-L105 |
28,522 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.display | public function display(array $options, View $view): void
{
$this->validateOptions($options);
$this->set('cakeView', $view);
$this->set('isBatch', $this->batch);
$this->set('isGroup', (bool)$this->getGroupByField());
$this->set('isSystem', (bool)$this->entity->get('system'))... | php | public function display(array $options, View $view): void
{
$this->validateOptions($options);
$this->set('cakeView', $view);
$this->set('isBatch', $this->batch);
$this->set('isGroup', (bool)$this->getGroupByField());
$this->set('isSystem', (bool)$this->entity->get('system'))... | [
"public",
"function",
"display",
"(",
"array",
"$",
"options",
",",
"View",
"$",
"view",
")",
":",
"void",
"{",
"$",
"this",
"->",
"validateOptions",
"(",
"$",
"options",
")",
";",
"$",
"this",
"->",
"set",
"(",
"'cakeView'",
",",
"$",
"view",
")",
... | Cell display method.
@param mixed[] $options Search options
@param \Cake\View\View $view View instance
@return void | [
"Cell",
"display",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L107-L123 |
28,523 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.validateOptions | private function validateOptions(array $options): void
{
foreach ($this->requiredOptions as $name) {
if (!array_key_exists($name, $options)) {
throw new InvalidArgumentException(sprintf('Required parameter "%s" is missing.', $name));
}
$this->{$name} = $o... | php | private function validateOptions(array $options): void
{
foreach ($this->requiredOptions as $name) {
if (!array_key_exists($name, $options)) {
throw new InvalidArgumentException(sprintf('Required parameter "%s" is missing.', $name));
}
$this->{$name} = $o... | [
"private",
"function",
"validateOptions",
"(",
"array",
"$",
"options",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"requiredOptions",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"options",
... | Validates required options and sets them as class properties.
@param mixed[] $options Search options
@return void | [
"Validates",
"required",
"options",
"and",
"sets",
"them",
"as",
"class",
"properties",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L131-L140 |
28,524 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getTableId | private function getTableId(): string
{
if ('' === $this->tableId) {
$this->tableId = 'table-datatable-' . md5($this->preSaveId);
}
return $this->tableId;
} | php | private function getTableId(): string
{
if ('' === $this->tableId) {
$this->tableId = 'table-datatable-' . md5($this->preSaveId);
}
return $this->tableId;
} | [
"private",
"function",
"getTableId",
"(",
")",
":",
"string",
"{",
"if",
"(",
"''",
"===",
"$",
"this",
"->",
"tableId",
")",
"{",
"$",
"this",
"->",
"tableId",
"=",
"'table-datatable-'",
".",
"md5",
"(",
"$",
"this",
"->",
"preSaveId",
")",
";",
"}"... | Html table id getter.
@return string | [
"Html",
"table",
"id",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L147-L154 |
28,525 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getGroupByField | private function getGroupByField(): string
{
if ('' === $this->groupByField) {
$this->groupByField = ! empty($this->searchData['group_by']) ? $this->searchData['group_by'] : '';
}
return $this->groupByField;
} | php | private function getGroupByField(): string
{
if ('' === $this->groupByField) {
$this->groupByField = ! empty($this->searchData['group_by']) ? $this->searchData['group_by'] : '';
}
return $this->groupByField;
} | [
"private",
"function",
"getGroupByField",
"(",
")",
":",
"string",
"{",
"if",
"(",
"''",
"===",
"$",
"this",
"->",
"groupByField",
")",
"{",
"$",
"this",
"->",
"groupByField",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"searchData",
"[",
"'group_by'",
... | Group field getter.
@return string | [
"Group",
"field",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L161-L168 |
28,526 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getExport | private function getExport(): bool
{
if (false === $this->export) {
$this->export = (bool)Configure::read('Search.dashboardExport');
}
return $this->export;
} | php | private function getExport(): bool
{
if (false === $this->export) {
$this->export = (bool)Configure::read('Search.dashboardExport');
}
return $this->export;
} | [
"private",
"function",
"getExport",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"export",
")",
"{",
"$",
"this",
"->",
"export",
"=",
"(",
"bool",
")",
"Configure",
"::",
"read",
"(",
"'Search.dashboardExport'",
")",
";",
... | Export status getter.
@return bool | [
"Export",
"status",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L175-L182 |
28,527 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getViewOptions | private function getViewOptions(): array
{
// search url if is a saved one
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
$title = $this->entity->has('name') ? $this->entity->get('name') : $controller;
$url = ['plugin' => $plugin, 'controller' => $controller,... | php | private function getViewOptions(): array
{
// search url if is a saved one
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
$title = $this->entity->has('name') ? $this->entity->get('name') : $controller;
$url = ['plugin' => $plugin, 'controller' => $controller,... | [
"private",
"function",
"getViewOptions",
"(",
")",
":",
"array",
"{",
"// search url if is a saved one",
"list",
"(",
"$",
"plugin",
",",
"$",
"controller",
")",
"=",
"pluginSplit",
"(",
"$",
"this",
"->",
"entity",
"->",
"get",
"(",
"'model'",
")",
")",
"... | View options getter.
@return mixed[] | [
"View",
"options",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L189-L210 |
28,528 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getTableHeaders | private function getTableHeaders(): array
{
$result = [];
foreach ($this->getDisplayColumns() as $column) {
$label = $column;
if (array_key_exists($label, $this->searchableFields)) {
$label = $this->searchableFields[$label]['label'];
}
... | php | private function getTableHeaders(): array
{
$result = [];
foreach ($this->getDisplayColumns() as $column) {
$label = $column;
if (array_key_exists($label, $this->searchableFields)) {
$label = $this->searchableFields[$label]['label'];
}
... | [
"private",
"function",
"getTableHeaders",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDisplayColumns",
"(",
")",
"as",
"$",
"column",
")",
"{",
"$",
"label",
"=",
"$",
"column",
";",
"if",
... | Html table headers getter.
@return mixed[] | [
"Html",
"table",
"headers",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L217-L235 |
28,529 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getDatatableOptions | private function getDatatableOptions(): array
{
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
$result = [
'table_id' => '#' . $this->getTableId(),
'order' => [$this->getOrderField(), $this->getOrderDirection()],
'ajax' => [
... | php | private function getDatatableOptions(): array
{
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
$result = [
'table_id' => '#' . $this->getTableId(),
'order' => [$this->getOrderField(), $this->getOrderDirection()],
'ajax' => [
... | [
"private",
"function",
"getDatatableOptions",
"(",
")",
":",
"array",
"{",
"list",
"(",
"$",
"plugin",
",",
"$",
"controller",
")",
"=",
"pluginSplit",
"(",
"$",
"this",
"->",
"entity",
"->",
"get",
"(",
"'model'",
")",
")",
";",
"$",
"result",
"=",
... | DataTable options getter.
@return mixed[] | [
"DataTable",
"options",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L242-L266 |
28,530 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getChartOptions | private function getChartOptions(): array
{
$groupByField = $this->getGroupByField();
if (!$groupByField) {
return [];
}
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
list($prefix, $fieldName) = pluginSplit($groupByField);
$resul... | php | private function getChartOptions(): array
{
$groupByField = $this->getGroupByField();
if (!$groupByField) {
return [];
}
list($plugin, $controller) = pluginSplit($this->entity->get('model'));
list($prefix, $fieldName) = pluginSplit($groupByField);
$resul... | [
"private",
"function",
"getChartOptions",
"(",
")",
":",
"array",
"{",
"$",
"groupByField",
"=",
"$",
"this",
"->",
"getGroupByField",
"(",
")",
";",
"if",
"(",
"!",
"$",
"groupByField",
")",
"{",
"return",
"[",
"]",
";",
"}",
"list",
"(",
"$",
"plug... | Chart options getter.
@return mixed[] | [
"Chart",
"options",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L273-L309 |
28,531 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getOrderField | private function getOrderField(): int
{
$result = (int)array_search($this->searchData['sort_by_field'], $this->getDisplayColumns());
if ($this->batch && !$this->getGroupByField()) {
$result += 1;
}
return $result;
} | php | private function getOrderField(): int
{
$result = (int)array_search($this->searchData['sort_by_field'], $this->getDisplayColumns());
if ($this->batch && !$this->getGroupByField()) {
$result += 1;
}
return $result;
} | [
"private",
"function",
"getOrderField",
"(",
")",
":",
"int",
"{",
"$",
"result",
"=",
"(",
"int",
")",
"array_search",
"(",
"$",
"this",
"->",
"searchData",
"[",
"'sort_by_field'",
"]",
",",
"$",
"this",
"->",
"getDisplayColumns",
"(",
")",
")",
";",
... | Sort column getter.
@return int | [
"Sort",
"column",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L316-L325 |
28,532 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getOrderDirection | private function getOrderDirection(): string
{
$result = !empty($this->searchData['sort_by_order']) ?
$this->searchData['sort_by_order'] :
Options::DEFAULT_SORT_BY_ORDER;
return $result;
} | php | private function getOrderDirection(): string
{
$result = !empty($this->searchData['sort_by_order']) ?
$this->searchData['sort_by_order'] :
Options::DEFAULT_SORT_BY_ORDER;
return $result;
} | [
"private",
"function",
"getOrderDirection",
"(",
")",
":",
"string",
"{",
"$",
"result",
"=",
"!",
"empty",
"(",
"$",
"this",
"->",
"searchData",
"[",
"'sort_by_order'",
"]",
")",
"?",
"$",
"this",
"->",
"searchData",
"[",
"'sort_by_order'",
"]",
":",
"O... | Sort direction getter.
@return string | [
"Sort",
"direction",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L332-L339 |
28,533 | QoboLtd/cakephp-search | src/View/Cell/ResultCell.php | ResultCell.getDatatableColumns | private function getDatatableColumns(): array
{
$result = $this->getDisplayColumns();
if (!$this->getGroupByField()) {
$result[] = Utility::MENU_PROPERTY_NAME;
}
if (!$this->getGroupByField() && $this->batch) {
$table = TableRegistry::get($this->entity->get(... | php | private function getDatatableColumns(): array
{
$result = $this->getDisplayColumns();
if (!$this->getGroupByField()) {
$result[] = Utility::MENU_PROPERTY_NAME;
}
if (!$this->getGroupByField() && $this->batch) {
$table = TableRegistry::get($this->entity->get(... | [
"private",
"function",
"getDatatableColumns",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getDisplayColumns",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getGroupByField",
"(",
")",
")",
"{",
"$",
"result",
"[",
"]",
"... | DataTable columns getter.
@return mixed[] | [
"DataTable",
"columns",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/View/Cell/ResultCell.php#L346-L363 |
28,534 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Base.php | Base.defaultAction | protected function defaultAction( ServerRequestInterface $request, ResponseInterface $response )
{
$status = 403;
$view = $this->getView();
$view->errors = array( array(
'title' => $this->getContext()->getI18n()->dt( 'client/jsonapi', 'Not allowed for this resource' ),
) );
/** client/jsonapi/standard/t... | php | protected function defaultAction( ServerRequestInterface $request, ResponseInterface $response )
{
$status = 403;
$view = $this->getView();
$view->errors = array( array(
'title' => $this->getContext()->getI18n()->dt( 'client/jsonapi', 'Not allowed for this resource' ),
) );
/** client/jsonapi/standard/t... | [
"protected",
"function",
"defaultAction",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"status",
"=",
"403",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"view",
"->",
... | Returns the default response for the resource
@param \Psr\Http\Message\ServerRequestInterface $request Request object
@param \Psr\Http\Message\ResponseInterface $response Response object
@return \Psr\Http\Message\ResponseInterface Modified response object | [
"Returns",
"the",
"default",
"response",
"for",
"the",
"resource"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Base.php#L169-L210 |
28,535 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Base.php | Base.getErrorDetails | protected function getErrorDetails( \Exception $e, $domain = null )
{
$details = [];
if( $domain !== null ) {
$details['title'] = $this->context->getI18n()->dt( $domain, $e->getMessage() );
} else {
$details['title'] = $e->getMessage();
}
/** client/jsonapi/debug
* Send debug information withing r... | php | protected function getErrorDetails( \Exception $e, $domain = null )
{
$details = [];
if( $domain !== null ) {
$details['title'] = $this->context->getI18n()->dt( $domain, $e->getMessage() );
} else {
$details['title'] = $e->getMessage();
}
/** client/jsonapi/debug
* Send debug information withing r... | [
"protected",
"function",
"getErrorDetails",
"(",
"\\",
"Exception",
"$",
"e",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"$",
"details",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"domain",
"!==",
"null",
")",
"{",
"$",
"details",
"[",
"'title'",
"]",
"="... | Returns the translated title and the details of the error
@param \Exception $e Thrown exception
@param string|null $domain Translation domain
@return array Associative list with "title" and "detail" key (if debug config is enabled) | [
"Returns",
"the",
"translated",
"title",
"and",
"the",
"details",
"of",
"the",
"error"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Base.php#L231-L259 |
28,536 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Base.php | Base.getOptionsResponse | public function getOptionsResponse( ServerRequestInterface $request, ResponseInterface $response, $allow )
{
$view = $this->getView();
$tplconf = 'client/jsonapi/standard/template-options';
$default = 'options-standard';
$body = $view->render( $view->config( $tplconf, $default ) );
return $response->withH... | php | public function getOptionsResponse( ServerRequestInterface $request, ResponseInterface $response, $allow )
{
$view = $this->getView();
$tplconf = 'client/jsonapi/standard/template-options';
$default = 'options-standard';
$body = $view->render( $view->config( $tplconf, $default ) );
return $response->withH... | [
"public",
"function",
"getOptionsResponse",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"allow",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"tplconf",
"=",
"'client/js... | Returns the available REST verbs and the available parameters
@param \Psr\Http\Message\ServerRequestInterface $request Request object
@param \Psr\Http\Message\ResponseInterface $response Response object
@param string $allow Allowed HTTP methods
@return \Psr\Http\Message\ResponseInterface Modified response object | [
"Returns",
"the",
"available",
"REST",
"verbs",
"and",
"the",
"available",
"parameters"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Base.php#L363-L377 |
28,537 | hiqdev/hipanel-module-finance | src/cart/storage/CartStorageFactory.php | CartStorageFactory.forUser | public static function forUser(User $user)
{
if ($user->getIsGuest()) {
return Yii::$app->session;
}
return Yii::createObject(['class' => RemoteCartStorage::class, 'sessionCartId' => 'yz\shoppingcart\ShoppingCart']);
} | php | public static function forUser(User $user)
{
if ($user->getIsGuest()) {
return Yii::$app->session;
}
return Yii::createObject(['class' => RemoteCartStorage::class, 'sessionCartId' => 'yz\shoppingcart\ShoppingCart']);
} | [
"public",
"static",
"function",
"forUser",
"(",
"User",
"$",
"user",
")",
"{",
"if",
"(",
"$",
"user",
"->",
"getIsGuest",
"(",
")",
")",
"{",
"return",
"Yii",
"::",
"$",
"app",
"->",
"session",
";",
"}",
"return",
"Yii",
"::",
"createObject",
"(",
... | CartStorageFactory constructor.
@param User $user
@return \yii\web\Session | [
"CartStorageFactory",
"constructor",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/cart/storage/CartStorageFactory.php#L29-L36 |
28,538 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Basket/Standard.php | Standard.getParts | protected function getParts( \Aimeos\MW\View\Iface $view )
{
$available = array(
'basket/address' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_ADDRESS,
'basket/coupon' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_COUPON,
'basket/product' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT,
'basket/servi... | php | protected function getParts( \Aimeos\MW\View\Iface $view )
{
$available = array(
'basket/address' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_ADDRESS,
'basket/coupon' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_COUPON,
'basket/product' => \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT,
'basket/servi... | [
"protected",
"function",
"getParts",
"(",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"View",
"\\",
"Iface",
"$",
"view",
")",
"{",
"$",
"available",
"=",
"array",
"(",
"'basket/address'",
"=>",
"\\",
"Aimeos",
"\\",
"MShop",
"\\",
"Order",
"\\",
"Item",
"\\",
"... | Returns the integer constant for the basket parts that should be included
@param \Aimeos\MW\View\Iface $view View instance
@return integer Constant from Aimeos\MShop\Order\Item\Base\Base | [
"Returns",
"the",
"integer",
"constant",
"for",
"the",
"basket",
"parts",
"that",
"should",
"be",
"included"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Basket/Standard.php#L256-L276 |
28,539 | TYPO3-CMS/redirects | Classes/ViewHelpers/TargetPageIdViewHelper.php | TargetPageIdViewHelper.renderStatic | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
{
if (!strpos($arguments['target'], 't3://page', 0) === 0) {
return '';
}
try {
$linkService = GeneralUtility::makeInstance(Lin... | php | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
{
if (!strpos($arguments['target'], 't3://page', 0) === 0) {
return '';
}
try {
$linkService = GeneralUtility::makeInstance(Lin... | [
"public",
"static",
"function",
"renderStatic",
"(",
"array",
"$",
"arguments",
",",
"\\",
"Closure",
"$",
"renderChildrenClosure",
",",
"RenderingContextInterface",
"$",
"renderingContext",
")",
":",
"string",
"{",
"if",
"(",
"!",
"strpos",
"(",
"$",
"arguments... | Renders the page ID
@param array $arguments
@param \Closure $renderChildrenClosure
@param RenderingContextInterface $renderingContext
@return string | [
"Renders",
"the",
"page",
"ID"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/ViewHelpers/TargetPageIdViewHelper.php#L51-L64 |
28,540 | BabDev/Transifex-API | src/Transifex.php | Transifex.get | public function get(string $name): ApiConnector
{
return $this->apiFactory->createApiConnector($name, $this->options);
} | php | public function get(string $name): ApiConnector
{
return $this->apiFactory->createApiConnector($name, $this->options);
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
":",
"ApiConnector",
"{",
"return",
"$",
"this",
"->",
"apiFactory",
"->",
"createApiConnector",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"options",
")",
";",
"}"
] | Factory method to fetch API objects.
@param string $name Name of the API object to retrieve
@return ApiConnector
@throws Exception\UnknownApiConnectorException | [
"Factory",
"method",
"to",
"fetch",
"API",
"objects",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Transifex.php#L48-L51 |
28,541 | hiqdev/hipanel-module-finance | src/models/DomainService.php | DomainService.tryResourceAssignation | public function tryResourceAssignation(DomainResource $resource)
{
if ($type = $this->matchType($resource)) {
$this->resources[$type] = $resource;
return true;
}
return false;
} | php | public function tryResourceAssignation(DomainResource $resource)
{
if ($type = $this->matchType($resource)) {
$this->resources[$type] = $resource;
return true;
}
return false;
} | [
"public",
"function",
"tryResourceAssignation",
"(",
"DomainResource",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"type",
"=",
"$",
"this",
"->",
"matchType",
"(",
"$",
"resource",
")",
")",
"{",
"$",
"this",
"->",
"resources",
"[",
"$",
"type",
"]",
"... | Tries to assign a resource in this service, if the type is correct.
@param DomainResource $resource
@return bool | [
"Tries",
"to",
"assign",
"a",
"resource",
"in",
"this",
"service",
"if",
"the",
"type",
"is",
"correct",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/models/DomainService.php#L51-L60 |
28,542 | mmoreram/ControllerExtraBundle | DependencyInjection/ControllerExtraExtension.php | ControllerExtraExtension.getConfigFiles | protected function getConfigFiles(array $config) : array
{
return [
'providers',
'annotations_resolver',
['resolver_form', $config['form']['active']],
['resolver_flush', $config['flush']['active']],
['resolver_entity', $config['entity']['active']],... | php | protected function getConfigFiles(array $config) : array
{
return [
'providers',
'annotations_resolver',
['resolver_form', $config['form']['active']],
['resolver_flush', $config['flush']['active']],
['resolver_entity', $config['entity']['active']],... | [
"protected",
"function",
"getConfigFiles",
"(",
"array",
"$",
"config",
")",
":",
"array",
"{",
"return",
"[",
"'providers'",
",",
"'annotations_resolver'",
",",
"[",
"'resolver_form'",
",",
"$",
"config",
"[",
"'form'",
"]",
"[",
"'active'",
"]",
"]",
",",
... | Config files to load.
Each array position can be a simple file name if must be loaded always,
or an array, with the filename in the first position, and a boolean in
the second one.
As a parameter, this method receives all loaded configuration, to allow
setting this boolean value from a configuration value.
return ar... | [
"Config",
"files",
"to",
"load",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/DependencyInjection/ControllerExtraExtension.php#L72-L86 |
28,543 | MetaModels/filter_perimetersearch | src/Helper/SphericalDistance.php | SphericalDistance.validateCoordinate | public static function validateCoordinate($coordinate): bool
{
if (!(is_numeric($coordinate)
&& (3 >= \strlen((int) \abs($coordinate)))
&& (6 >= (\strlen($coordinate) - \strlen((int) $coordinate) - 1)))
) {
return false;
}
return true;
} | php | public static function validateCoordinate($coordinate): bool
{
if (!(is_numeric($coordinate)
&& (3 >= \strlen((int) \abs($coordinate)))
&& (6 >= (\strlen($coordinate) - \strlen((int) $coordinate) - 1)))
) {
return false;
}
return true;
} | [
"public",
"static",
"function",
"validateCoordinate",
"(",
"$",
"coordinate",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"(",
"is_numeric",
"(",
"$",
"coordinate",
")",
"&&",
"(",
"3",
">=",
"\\",
"strlen",
"(",
"(",
"int",
")",
"\\",
"abs",
"(",
"$",
... | Validate the coordinate.
@param string|float $coordinate The latitude or longitude coordinate.
@return bool | [
"Validate",
"the",
"coordinate",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/Helper/SphericalDistance.php#L154-L164 |
28,544 | TYPO3-CMS/redirects | Classes/Service/UrlService.php | UrlService.getDefaultUrl | public function getDefaultUrl(): string
{
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
$firstPageInTree = $connection->select(['uid'], 'pages', ['pid' => 0], [], ['sorting' => 'ASC'], 1)->fetchColumn(0);
$url = BackendUtility::getViewDoma... | php | public function getDefaultUrl(): string
{
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
$firstPageInTree = $connection->select(['uid'], 'pages', ['pid' => 0], [], ['sorting' => 'ASC'], 1)->fetchColumn(0);
$url = BackendUtility::getViewDoma... | [
"public",
"function",
"getDefaultUrl",
"(",
")",
":",
"string",
"{",
"$",
"connection",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"ConnectionPool",
"::",
"class",
")",
"->",
"getConnectionForTable",
"(",
"'pages'",
")",
";",
"$",
"firstPageInTree",
"=",
... | Retrieves the first valid URL
@return string a URL like "http://example.org" | [
"Retrieves",
"the",
"first",
"valid",
"URL"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Service/UrlService.php#L34-L41 |
28,545 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Common/Decorator/Base.php | Base.setView | public function setView( \Aimeos\MW\View\Iface $view )
{
$this->client->setView( $view );
parent::setView( $view );
return $this;
} | php | public function setView( \Aimeos\MW\View\Iface $view )
{
$this->client->setView( $view );
parent::setView( $view );
return $this;
} | [
"public",
"function",
"setView",
"(",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"View",
"\\",
"Iface",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"setView",
"(",
"$",
"view",
")",
";",
"parent",
"::",
"setView",
"(",
"$",
"view",
")",
";",
... | Sets the view object that will generate the admin output.
@param \Aimeos\MW\View\Iface $view The view object which generates the admin output
@return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls | [
"Sets",
"the",
"view",
"object",
"that",
"will",
"generate",
"the",
"admin",
"output",
"."
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Common/Decorator/Base.php#L159-L165 |
28,546 | QoboLtd/cakephp-search | src/Utility.php | Utility.instance | public static function instance(Utility $utility = null)
{
if ($utility instanceof Utility) {
static::$instance = $utility;
}
if (empty(static::$instance)) {
static::$instance = new static();
}
return static::$instance;
} | php | public static function instance(Utility $utility = null)
{
if ($utility instanceof Utility) {
static::$instance = $utility;
}
if (empty(static::$instance)) {
static::$instance = new static();
}
return static::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
"Utility",
"$",
"utility",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"utility",
"instanceof",
"Utility",
")",
"{",
"static",
"::",
"$",
"instance",
"=",
"$",
"utility",
";",
"}",
"if",
"(",
"empty",
"(",
... | Returns the globally available instance of a Search\Utility.
@param \Search\Utility|null $utility Utility instance
@return static The global search utility | [
"Returns",
"the",
"globally",
"available",
"instance",
"of",
"a",
"Search",
"\\",
"Utility",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility.php#L62-L73 |
28,547 | QoboLtd/cakephp-search | src/Utility.php | Utility.getSearchableFields | public function getSearchableFields(RepositoryInterface $table, array $user) : array
{
$alias = $table->getAlias();
if (!empty($this->searchableFields[$alias])) {
return $this->searchableFields[$alias];
}
$event = new Event((string)EventName::MODEL_SEARCH_SEARCHABLE_FIE... | php | public function getSearchableFields(RepositoryInterface $table, array $user) : array
{
$alias = $table->getAlias();
if (!empty($this->searchableFields[$alias])) {
return $this->searchableFields[$alias];
}
$event = new Event((string)EventName::MODEL_SEARCH_SEARCHABLE_FIE... | [
"public",
"function",
"getSearchableFields",
"(",
"RepositoryInterface",
"$",
"table",
",",
"array",
"$",
"user",
")",
":",
"array",
"{",
"$",
"alias",
"=",
"$",
"table",
"->",
"getAlias",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",... | Return Table's searchable fields.
@param \Cake\Datasource\RepositoryInterface $table Table object
@param mixed[] $user User info
@return mixed[] | [
"Return",
"Table",
"s",
"searchable",
"fields",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility.php#L82-L99 |
28,548 | QoboLtd/cakephp-search | src/Utility.php | Utility.formatter | public function formatter(ResultSetInterface $resultSet, array $fields, RepositoryInterface $table, array $user) : array
{
$result = [];
if ($resultSet->isEmpty()) {
return $result;
}
$cakeView = new View();
$registryAlias = $table->getRegistryAlias();
$... | php | public function formatter(ResultSetInterface $resultSet, array $fields, RepositoryInterface $table, array $user) : array
{
$result = [];
if ($resultSet->isEmpty()) {
return $result;
}
$cakeView = new View();
$registryAlias = $table->getRegistryAlias();
$... | [
"public",
"function",
"formatter",
"(",
"ResultSetInterface",
"$",
"resultSet",
",",
"array",
"$",
"fields",
",",
"RepositoryInterface",
"$",
"table",
",",
"array",
"$",
"user",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
... | Method that formats resultset.
@param \Cake\Datasource\ResultSetInterface $resultSet ResultSet
@param string[] $fields Display fields
@param \Cake\Datasource\RepositoryInterface $table Table instance
@param mixed[] $user User info
@return mixed[] | [
"Method",
"that",
"formats",
"resultset",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility.php#L110-L150 |
28,549 | QoboLtd/cakephp-search | src/Utility.php | Utility.getAssociationLabels | public function getAssociationLabels(RepositoryInterface $table) : array
{
/** @var \Cake\ORM\Table */
$table = $table;
$result = [];
foreach ($table->associations() as $association) {
if (!in_array($association->type(), $this->searchableAssociations)) {
... | php | public function getAssociationLabels(RepositoryInterface $table) : array
{
/** @var \Cake\ORM\Table */
$table = $table;
$result = [];
foreach ($table->associations() as $association) {
if (!in_array($association->type(), $this->searchableAssociations)) {
... | [
"public",
"function",
"getAssociationLabels",
"(",
"RepositoryInterface",
"$",
"table",
")",
":",
"array",
"{",
"/** @var \\Cake\\ORM\\Table */",
"$",
"table",
"=",
"$",
"table",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"table",
"->",
"as... | Associations labels getter.
@param \Cake\Datasource\RepositoryInterface $table Table instance
@return mixed[] | [
"Associations",
"labels",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility.php#L199-L214 |
28,550 | mmoreram/ControllerExtraBundle | Resolver/AnnotationResolverCollector.php | AnnotationResolverCollector.analyzeRequest | public function analyzeRequest(
Request $request,
Reader $reader,
ReflectionMethod $method
) {
/**
* Annotations load.
*/
$methodAnnotations = $reader->getMethodAnnotations($method);
/**
* Every annotation found is parsed.
*/
... | php | public function analyzeRequest(
Request $request,
Reader $reader,
ReflectionMethod $method
) {
/**
* Annotations load.
*/
$methodAnnotations = $reader->getMethodAnnotations($method);
/**
* Every annotation found is parsed.
*/
... | [
"public",
"function",
"analyzeRequest",
"(",
"Request",
"$",
"request",
",",
"Reader",
"$",
"reader",
",",
"ReflectionMethod",
"$",
"method",
")",
"{",
"/**\n * Annotations load.\n */",
"$",
"methodAnnotations",
"=",
"$",
"reader",
"->",
"getMethodAnno... | Evaluate request.
@param Request $request
@param Reader $reader
@param ReflectionMethod $method | [
"Evaluate",
"request",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/AnnotationResolverCollector.php#L121-L144 |
28,551 | mmoreram/ControllerExtraBundle | Resolver/AnnotationResolverCollector.php | AnnotationResolverCollector.analyzeAnnotation | public function analyzeAnnotation(
Request $request,
ReflectionMethod $method,
Annotation $annotation,
array $resolverStack
) {
/**
* Every resolver must evaluate its logic.
*/
foreach ($resolverStack as $resolver) {
$resolver->evaluateA... | php | public function analyzeAnnotation(
Request $request,
ReflectionMethod $method,
Annotation $annotation,
array $resolverStack
) {
/**
* Every resolver must evaluate its logic.
*/
foreach ($resolverStack as $resolver) {
$resolver->evaluateA... | [
"public",
"function",
"analyzeAnnotation",
"(",
"Request",
"$",
"request",
",",
"ReflectionMethod",
"$",
"method",
",",
"Annotation",
"$",
"annotation",
",",
"array",
"$",
"resolverStack",
")",
"{",
"/**\n * Every resolver must evaluate its logic.\n */",
"... | Allow every available resolver to solve its own logic.
@param Request $request
@param ReflectionMethod $method
@param Annotation $annotation
@param array $resolverStack | [
"Allow",
"every",
"available",
"resolver",
"to",
"solve",
"its",
"own",
"logic",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/AnnotationResolverCollector.php#L154-L167 |
28,552 | MetaModels/filter_perimetersearch | src/Helper/HaversineSphericalDistance.php | HaversineSphericalDistance.getFormulaAsQueryPart | public static function getFormulaAsQueryPart(
$firstLatitude,
$firstLongitude,
$secondLatitude,
$secondLongitude,
$digits = 0,
$earthRadius = self::EARTH_RADIUS_IN_KM
): string {
return \sprintf(
'ROUND(
SQRT(
PO... | php | public static function getFormulaAsQueryPart(
$firstLatitude,
$firstLongitude,
$secondLatitude,
$secondLongitude,
$digits = 0,
$earthRadius = self::EARTH_RADIUS_IN_KM
): string {
return \sprintf(
'ROUND(
SQRT(
PO... | [
"public",
"static",
"function",
"getFormulaAsQueryPart",
"(",
"$",
"firstLatitude",
",",
"$",
"firstLongitude",
",",
"$",
"secondLatitude",
",",
"$",
"secondLongitude",
",",
"$",
"digits",
"=",
"0",
",",
"$",
"earthRadius",
"=",
"self",
"::",
"EARTH_RADIUS_IN_KM... | Get the spherical distance haversine formula for the database query part.
@param string|float $firstLatitude The first latitude coordinate. You can a coordinate or a database field.
@param string|float $firstLongitude The first longitude coordinate. You can a coordinate or a database field.
@param string|float $sec... | [
"Get",
"the",
"spherical",
"distance",
"haversine",
"formula",
"for",
"the",
"database",
"query",
"part",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/Helper/HaversineSphericalDistance.php#L42-L65 |
28,553 | MetaModels/filter_perimetersearch | src/Helper/HaversineSphericalDistance.php | HaversineSphericalDistance.calculate | public static function calculate(
float $firstLatitude,
float $firstLongitude,
float $secondLatitude,
float $secondLongitude,
int $digits = 0,
int $earthRadius = self::EARTH_RADIUS_IN_KM
): float {
$oneRad = ((2 * M_PI) / 360);
return \round(
... | php | public static function calculate(
float $firstLatitude,
float $firstLongitude,
float $secondLatitude,
float $secondLongitude,
int $digits = 0,
int $earthRadius = self::EARTH_RADIUS_IN_KM
): float {
$oneRad = ((2 * M_PI) / 360);
return \round(
... | [
"public",
"static",
"function",
"calculate",
"(",
"float",
"$",
"firstLatitude",
",",
"float",
"$",
"firstLongitude",
",",
"float",
"$",
"secondLatitude",
",",
"float",
"$",
"secondLongitude",
",",
"int",
"$",
"digits",
"=",
"0",
",",
"int",
"$",
"earthRadiu... | Calculate the spherical distance with the haversine formula.
@param float $firstLatitude The first latitude coordinate.
@param float $firstLongitude The first longitude coordinate.
@param float $secondLatitude The second latitude coordinate.
@param float $secondLongitude The second longitude coordinate.
@param int... | [
"Calculate",
"the",
"spherical",
"distance",
"with",
"the",
"haversine",
"formula",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/Helper/HaversineSphericalDistance.php#L79-L97 |
28,554 | QoboLtd/cakephp-search | src/Model/Table/AppWidgetsTable.php | AppWidgetsTable._saveAppWidgets | protected function _saveAppWidgets(): void
{
$widgets = $this->_getAppWidgets();
$found = [];
foreach ($widgets as $widget) {
$found[] = $widget['name'];
// skip adding existing app widgets
if ($this->exists(['AppWidgets.name' => $widget['name']])) {
... | php | protected function _saveAppWidgets(): void
{
$widgets = $this->_getAppWidgets();
$found = [];
foreach ($widgets as $widget) {
$found[] = $widget['name'];
// skip adding existing app widgets
if ($this->exists(['AppWidgets.name' => $widget['name']])) {
... | [
"protected",
"function",
"_saveAppWidgets",
"(",
")",
":",
"void",
"{",
"$",
"widgets",
"=",
"$",
"this",
"->",
"_getAppWidgets",
"(",
")",
";",
"$",
"found",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"widgets",
"as",
"$",
"widget",
")",
"{",
"$",
"... | Store application scope widgets into the database.
@return void | [
"Store",
"application",
"scope",
"widgets",
"into",
"the",
"database",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Table/AppWidgetsTable.php#L127-L147 |
28,555 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.getCountryInformation | protected function getCountryInformation()
{
// Get the country for the lookup.
$country = null;
if (('get' === $this->get('countrymode')) && $this->get('country_get')) {
$getValue = Input::get($this->get('country_get')) ?: Input::post($this->get('country_get'));
$ge... | php | protected function getCountryInformation()
{
// Get the country for the lookup.
$country = null;
if (('get' === $this->get('countrymode')) && $this->get('country_get')) {
$getValue = Input::get($this->get('country_get')) ?: Input::post($this->get('country_get'));
$ge... | [
"protected",
"function",
"getCountryInformation",
"(",
")",
"{",
"// Get the country for the lookup.",
"$",
"country",
"=",
"null",
";",
"if",
"(",
"(",
"'get'",
"===",
"$",
"this",
"->",
"get",
"(",
"'countrymode'",
")",
")",
"&&",
"$",
"this",
"->",
"get",... | Try to get a valid country information.
@return string|null The country short tag (2-letters) or null. | [
"Try",
"to",
"get",
"a",
"valid",
"country",
"information",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L200-L216 |
28,556 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.getSearchWidget | private function getSearchWidget(FrontendFilterOptions $frontendFilterOptions)
{
$widget = [
'label' => [
($this->get('label') ?: $this->getAttributeName()),
'GET: ' . $this->getParamName(),
],
'inputType' => 'text',
'count'... | php | private function getSearchWidget(FrontendFilterOptions $frontendFilterOptions)
{
$widget = [
'label' => [
($this->get('label') ?: $this->getAttributeName()),
'GET: ' . $this->getParamName(),
],
'inputType' => 'text',
'count'... | [
"private",
"function",
"getSearchWidget",
"(",
"FrontendFilterOptions",
"$",
"frontendFilterOptions",
")",
"{",
"$",
"widget",
"=",
"[",
"'label'",
"=>",
"[",
"(",
"$",
"this",
"->",
"get",
"(",
"'label'",
")",
"?",
":",
"$",
"this",
"->",
"getAttributeName"... | Get the widget information for the search field.
@param FrontendFilterOptions $frontendFilterOptions The FE options.
@return array | [
"Get",
"the",
"widget",
"information",
"for",
"the",
"search",
"field",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L302-L321 |
28,557 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.getRangeWidget | private function getRangeWidget()
{
if ('selection' === $this->get('rangemode')) {
// Get all range options.
$rangeOptions = [];
foreach (StringUtil::deserialize($this->get('range_selection'), true) as $rangeItem) {
$rangeOptions[$rangeItem['range']] = $r... | php | private function getRangeWidget()
{
if ('selection' === $this->get('rangemode')) {
// Get all range options.
$rangeOptions = [];
foreach (StringUtil::deserialize($this->get('range_selection'), true) as $rangeItem) {
$rangeOptions[$rangeItem['range']] = $r... | [
"private",
"function",
"getRangeWidget",
"(",
")",
"{",
"if",
"(",
"'selection'",
"===",
"$",
"this",
"->",
"get",
"(",
"'rangemode'",
")",
")",
"{",
"// Get all range options.",
"$",
"rangeOptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"StringUtil",
"::",
... | Get the widget for the distance.
@return array|null | [
"Get",
"the",
"widget",
"for",
"the",
"distance",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L329-L375 |
28,558 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.lookupGeo | protected function lookupGeo($address, $country)
{
// Trim the data. Better!
$address = \trim($address);
$country = \trim($country);
// First check cache.
$cacheResult = $this->getFromCache($address, $country);
if (null !== $cacheResult) {
return $cacheRe... | php | protected function lookupGeo($address, $country)
{
// Trim the data. Better!
$address = \trim($address);
$country = \trim($country);
// First check cache.
$cacheResult = $this->getFromCache($address, $country);
if (null !== $cacheResult) {
return $cacheRe... | [
"protected",
"function",
"lookupGeo",
"(",
"$",
"address",
",",
"$",
"country",
")",
"{",
"// Trim the data. Better!",
"$",
"address",
"=",
"\\",
"trim",
"(",
"$",
"address",
")",
";",
"$",
"country",
"=",
"\\",
"trim",
"(",
"$",
"country",
")",
";",
"... | User the provider classes to make a look up.
@param string $address The full address to search for.
@param string $country The country as 2-letters form.
@return Container|null Return the container with all information or null on error. | [
"User",
"the",
"provider",
"classes",
"to",
"make",
"a",
"look",
"up",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L505-L555 |
28,559 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.getObjectFromName | protected function getObjectFromName($lookupClassName)
{
// Check if we know this class.
if (!isset($GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName])) {
return null;
}
$reflectionName = $GLOBALS['METAMODELS']['filters']['perimeterse... | php | protected function getObjectFromName($lookupClassName)
{
// Check if we know this class.
if (!isset($GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName])) {
return null;
}
$reflectionName = $GLOBALS['METAMODELS']['filters']['perimeterse... | [
"protected",
"function",
"getObjectFromName",
"(",
"$",
"lookupClassName",
")",
"{",
"// Check if we know this class.",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'METAMODELS'",
"]",
"[",
"'filters'",
"]",
"[",
"'perimetersearch'",
"]",
"[",
"'resolve_cla... | Try to get a object from the given class.
@param string $lookupClassName The name of the class.
@return null|object
@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName) | [
"Try",
"to",
"get",
"a",
"object",
"from",
"the",
"given",
"class",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L567-L592 |
28,560 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.addToCache | protected function addToCache($address, $country, $result)
{
$this->connection->insert(
'tl_metamodel_perimetersearch',
[
$this->connection->quoteIdentifier('search') => $address,
$this->connection->quoteIdentifier('country') => $country,
... | php | protected function addToCache($address, $country, $result)
{
$this->connection->insert(
'tl_metamodel_perimetersearch',
[
$this->connection->quoteIdentifier('search') => $address,
$this->connection->quoteIdentifier('country') => $country,
... | [
"protected",
"function",
"addToCache",
"(",
"$",
"address",
",",
"$",
"country",
",",
"$",
"result",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"insert",
"(",
"'tl_metamodel_perimetersearch'",
",",
"[",
"$",
"this",
"->",
"connection",
"->",
"quoteIden... | Add data to the cache.
@param string $address The address which where use for the search.
@param string $country The country.
@param Container $result The container with all information.
@return void
@throws \Doctrine\DBAL\DBALException When insert fails. | [
"Add",
"data",
"to",
"the",
"cache",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L605-L616 |
28,561 | MetaModels/filter_perimetersearch | src/FilterSetting/Perimetersearch.php | Perimetersearch.getFromCache | protected function getFromCache($address, $country)
{
$builder = $this->connection->createQueryBuilder();
$builder
->select('*')
->from($this->connection->quoteIdentifier('tl_metamodel_perimetersearch'))
->where($builder->expr()->eq($this->connection->quoteIdentif... | php | protected function getFromCache($address, $country)
{
$builder = $this->connection->createQueryBuilder();
$builder
->select('*')
->from($this->connection->quoteIdentifier('tl_metamodel_perimetersearch'))
->where($builder->expr()->eq($this->connection->quoteIdentif... | [
"protected",
"function",
"getFromCache",
"(",
"$",
"address",
",",
"$",
"country",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"connection",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"builder",
"->",
"select",
"(",
"'*'",
")",
"->",
"from",
... | Get data from cache.
@param string $address The address which where use for the search.
@param string $country The country.
@return Container|null | [
"Get",
"data",
"from",
"cache",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterSetting/Perimetersearch.php#L626-L661 |
28,562 | MetaModels/filter_perimetersearch | src/FilterRules/Perimetersearch.php | Perimetersearch.getMetaModelTableName | private function getMetaModelTableName()
{
$attribute = ((int) $this->mode === self::MODE_SINGLE) ? $this->singleAttribute : $this->latitudeAttribute;
return $attribute
->getMetaModel()
->getTableName();
} | php | private function getMetaModelTableName()
{
$attribute = ((int) $this->mode === self::MODE_SINGLE) ? $this->singleAttribute : $this->latitudeAttribute;
return $attribute
->getMetaModel()
->getTableName();
} | [
"private",
"function",
"getMetaModelTableName",
"(",
")",
"{",
"$",
"attribute",
"=",
"(",
"(",
"int",
")",
"$",
"this",
"->",
"mode",
"===",
"self",
"::",
"MODE_SINGLE",
")",
"?",
"$",
"this",
"->",
"singleAttribute",
":",
"$",
"this",
"->",
"latitudeAt... | Get the table name from the MetaModel.
@return string | [
"Get",
"the",
"table",
"name",
"from",
"the",
"MetaModel",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterRules/Perimetersearch.php#L160-L167 |
28,563 | MetaModels/filter_perimetersearch | src/FilterRules/Perimetersearch.php | Perimetersearch.checkAttributeTypes | private function checkAttributeTypes($latitudeAttribute, $longitudeAttribute, $singleAttribute)
{
if (null !== $singleAttribute) {
$this->checkMultiAttribute($singleAttribute);
$this->mode = self::MODE_SINGLE;
return;
}
if ((null !== $latitudeAttribute) &... | php | private function checkAttributeTypes($latitudeAttribute, $longitudeAttribute, $singleAttribute)
{
if (null !== $singleAttribute) {
$this->checkMultiAttribute($singleAttribute);
$this->mode = self::MODE_SINGLE;
return;
}
if ((null !== $latitudeAttribute) &... | [
"private",
"function",
"checkAttributeTypes",
"(",
"$",
"latitudeAttribute",
",",
"$",
"longitudeAttribute",
",",
"$",
"singleAttribute",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"singleAttribute",
")",
"{",
"$",
"this",
"->",
"checkMultiAttribute",
"(",
"$",
... | Check the attribute.
@param IAttribute $latitudeAttribute The attribute to be checked.
@param IAttribute $longitudeAttribute The attribute to be checked.
@param IAttribute $singleAttribute The attribute to be checked.
@return void
@throws \InvalidArgumentException If we have no single attribute or the lang/lot a... | [
"Check",
"the",
"attribute",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterRules/Perimetersearch.php#L197-L215 |
28,564 | MetaModels/filter_perimetersearch | src/FilterRules/Perimetersearch.php | Perimetersearch.checkSingleAttributes | private function checkSingleAttributes($latitudeAttribute, $longitudeAttribute)
{
// Check if both of the are simple
if (!($latitudeAttribute instanceof ISimple) || !($longitudeAttribute instanceof ISimple)) {
throw new \InvalidArgumentException('Only simple attributes are allowed.');
... | php | private function checkSingleAttributes($latitudeAttribute, $longitudeAttribute)
{
// Check if both of the are simple
if (!($latitudeAttribute instanceof ISimple) || !($longitudeAttribute instanceof ISimple)) {
throw new \InvalidArgumentException('Only simple attributes are allowed.');
... | [
"private",
"function",
"checkSingleAttributes",
"(",
"$",
"latitudeAttribute",
",",
"$",
"longitudeAttribute",
")",
"{",
"// Check if both of the are simple",
"if",
"(",
"!",
"(",
"$",
"latitudeAttribute",
"instanceof",
"ISimple",
")",
"||",
"!",
"(",
"$",
"longitud... | Check the single attributes.
@param IAttribute $latitudeAttribute The attribute to be checked.
@param IAttribute $longitudeAttribute The attribute to be checked.
@return void
@throws \InvalidArgumentException If one of the attribute is not from type ISimple. | [
"Check",
"the",
"single",
"attributes",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterRules/Perimetersearch.php#L244-L254 |
28,565 | MetaModels/filter_perimetersearch | src/FilterRules/Perimetersearch.php | Perimetersearch.runSimpleQuery | protected function runSimpleQuery($idField, $tableName, $latitudeField, $longitudeField, $additionalWhere)
{
$distanceCalculation = HaversineSphericalDistance::getFormulaAsQueryPart(
$this->latitude,
$this->longitude,
$this->connection->quoteIdentifier($latitudeField),
... | php | protected function runSimpleQuery($idField, $tableName, $latitudeField, $longitudeField, $additionalWhere)
{
$distanceCalculation = HaversineSphericalDistance::getFormulaAsQueryPart(
$this->latitude,
$this->longitude,
$this->connection->quoteIdentifier($latitudeField),
... | [
"protected",
"function",
"runSimpleQuery",
"(",
"$",
"idField",
",",
"$",
"tableName",
",",
"$",
"latitudeField",
",",
"$",
"longitudeField",
",",
"$",
"additionalWhere",
")",
"{",
"$",
"distanceCalculation",
"=",
"HaversineSphericalDistance",
"::",
"getFormulaAsQue... | Build the SQL and execute it.
@param string $idField Name of the id field.
@param string $tableName The name of the table.
@param string $latitudeField The name of the latitude field.
@param string $longitudeField The name of the longitude field.
@param array|null $additionalWhere A li... | [
"Build",
"the",
"SQL",
"and",
"execute",
"it",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterRules/Perimetersearch.php#L291-L329 |
28,566 | MetaModels/filter_perimetersearch | src/FilterRules/Perimetersearch.php | Perimetersearch.buildAdditionalWhere | protected function buildAdditionalWhere($additionalWhere)
{
if (null === $additionalWhere) {
return null;
}
$sql = \implode(' AND ', \array_keys((array) $additionalWhere));
return ('' !== $sql) ? $sql . ' AND ' : null;
} | php | protected function buildAdditionalWhere($additionalWhere)
{
if (null === $additionalWhere) {
return null;
}
$sql = \implode(' AND ', \array_keys((array) $additionalWhere));
return ('' !== $sql) ? $sql . ' AND ' : null;
} | [
"protected",
"function",
"buildAdditionalWhere",
"(",
"$",
"additionalWhere",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"additionalWhere",
")",
"{",
"return",
"null",
";",
"}",
"$",
"sql",
"=",
"\\",
"implode",
"(",
"' AND '",
",",
"\\",
"array_keys",
"(",
... | Build a where ...
@param array $additionalWhere A list with additional where information.
@return null|string
@deprecated This is deprecated since 2.1 and where remove in 3.0. | [
"Build",
"a",
"where",
"..."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterRules/Perimetersearch.php#L340-L349 |
28,567 | hiqdev/hipanel-module-finance | src/logic/AbstractTariffManager.php | AbstractTariffManager.determineParentTariff | protected function determineParentTariff()
{
if ($this->tariff === null) {
if (!empty($this->parent_id)) {
return $this->parent_id;
}
return null;
}
if ($this->tariff->parent_id !== null) {
return $this->tariff->parent_id;
... | php | protected function determineParentTariff()
{
if ($this->tariff === null) {
if (!empty($this->parent_id)) {
return $this->parent_id;
}
return null;
}
if ($this->tariff->parent_id !== null) {
return $this->tariff->parent_id;
... | [
"protected",
"function",
"determineParentTariff",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tariff",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"parent_id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"parent_id",
"... | Finds parent tariff ID.
@return int | [
"Finds",
"parent",
"tariff",
"ID",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/logic/AbstractTariffManager.php#L112-L127 |
28,568 | TYPO3-CMS/redirects | Classes/Http/Middleware/RedirectHandler.php | RedirectHandler.process | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$redirectService = GeneralUtility::makeInstance(RedirectService::class);
$port = $request->getUri()->getPort();
$matchedRedirect = $redirectService->matchRedirect(
$req... | php | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$redirectService = GeneralUtility::makeInstance(RedirectService::class);
$port = $request->getUri()->getPort();
$matchedRedirect = $redirectService->matchRedirect(
$req... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"$",
"redirectService",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"RedirectService",
"::",
"clas... | First hook within the Frontend Request handling
@param ServerRequestInterface $request
@param RequestHandlerInterface $handler
@return ResponseInterface | [
"First",
"hook",
"within",
"the",
"Frontend",
"Request",
"handling"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Http/Middleware/RedirectHandler.php#L48-L71 |
28,569 | TYPO3-CMS/redirects | Classes/Http/Middleware/RedirectHandler.php | RedirectHandler.buildRedirectResponse | protected function buildRedirectResponse(UriInterface $uri, array $redirectRecord): ResponseInterface
{
return new RedirectResponse(
$uri,
(int)$redirectRecord['target_statuscode'],
['X-Redirect-By' => 'TYPO3 Redirect ' . $redirectRecord['uid']]
);
} | php | protected function buildRedirectResponse(UriInterface $uri, array $redirectRecord): ResponseInterface
{
return new RedirectResponse(
$uri,
(int)$redirectRecord['target_statuscode'],
['X-Redirect-By' => 'TYPO3 Redirect ' . $redirectRecord['uid']]
);
} | [
"protected",
"function",
"buildRedirectResponse",
"(",
"UriInterface",
"$",
"uri",
",",
"array",
"$",
"redirectRecord",
")",
":",
"ResponseInterface",
"{",
"return",
"new",
"RedirectResponse",
"(",
"$",
"uri",
",",
"(",
"int",
")",
"$",
"redirectRecord",
"[",
... | Creates a PSR-7 compatible Response object
@param UriInterface $uri
@param array $redirectRecord
@return ResponseInterface | [
"Creates",
"a",
"PSR",
"-",
"7",
"compatible",
"Response",
"object"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Http/Middleware/RedirectHandler.php#L80-L87 |
28,570 | TYPO3-CMS/redirects | Classes/Http/Middleware/RedirectHandler.php | RedirectHandler.incrementHitCount | protected function incrementHitCount(array $redirectRecord)
{
// Track the hit if not disabled
if (!GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('redirects.hitCount') || $redirectRecord['disable_hitcount']) {
return;
}
$queryBuilder = GeneralUtility::ma... | php | protected function incrementHitCount(array $redirectRecord)
{
// Track the hit if not disabled
if (!GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('redirects.hitCount') || $redirectRecord['disable_hitcount']) {
return;
}
$queryBuilder = GeneralUtility::ma... | [
"protected",
"function",
"incrementHitCount",
"(",
"array",
"$",
"redirectRecord",
")",
"{",
"// Track the hit if not disabled",
"if",
"(",
"!",
"GeneralUtility",
"::",
"makeInstance",
"(",
"Features",
"::",
"class",
")",
"->",
"isFeatureEnabled",
"(",
"'redirects.hit... | Updates the sys_record's hit counter by one
@param array $redirectRecord | [
"Updates",
"the",
"sys_record",
"s",
"hit",
"counter",
"by",
"one"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Http/Middleware/RedirectHandler.php#L94-L110 |
28,571 | hiqdev/hipanel-module-finance | src/grid/BillGridView.php | BillGridView.objectLink | public function objectLink(Bill $model): string
{
return $model->class === 'device'
? Html::a($model->object, ['@server/view', 'id' => $model->object_id])
: Html::tag('b', $model->object);
} | php | public function objectLink(Bill $model): string
{
return $model->class === 'device'
? Html::a($model->object, ['@server/view', 'id' => $model->object_id])
: Html::tag('b', $model->object);
} | [
"public",
"function",
"objectLink",
"(",
"Bill",
"$",
"model",
")",
":",
"string",
"{",
"return",
"$",
"model",
"->",
"class",
"===",
"'device'",
"?",
"Html",
"::",
"a",
"(",
"$",
"model",
"->",
"object",
",",
"[",
"'@server/view'",
",",
"'id'",
"=>",
... | Creates link to object details page.
@param Bill $model
@return string | [
"Creates",
"link",
"to",
"object",
"details",
"page",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/grid/BillGridView.php#L227-L232 |
28,572 | TYPO3-CMS/redirects | Classes/FormDataProvider/ValuePickerItemDataProvider.php | ValuePickerItemDataProvider.getHosts | protected function getHosts(): array
{
$domains = [];
foreach ($this->siteFinder->getAllSites() as $site) {
foreach ($site->getAllLanguages() as $language) {
$domains[] = $language->getBase()->getHost();
}
}
$domains = array_unique($domains);
... | php | protected function getHosts(): array
{
$domains = [];
foreach ($this->siteFinder->getAllSites() as $site) {
foreach ($site->getAllLanguages() as $language) {
$domains[] = $language->getBase()->getHost();
}
}
$domains = array_unique($domains);
... | [
"protected",
"function",
"getHosts",
"(",
")",
":",
"array",
"{",
"$",
"domains",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"siteFinder",
"->",
"getAllSites",
"(",
")",
"as",
"$",
"site",
")",
"{",
"foreach",
"(",
"$",
"site",
"->",
"g... | Get all hosts from sites
@return array domain records | [
"Get",
"all",
"hosts",
"from",
"sites"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/FormDataProvider/ValuePickerItemDataProvider.php#L68-L79 |
28,573 | BabDev/Transifex-API | src/Connector/Translations.php | Translations.getTranslation | public function getTranslation(
string $project,
string $resource,
string $lang,
string $mode = ''
): ResponseInterface {
$uri = $this->createUri("/api/2/project/$project/resource/$resource/translation/$lang");
if (!empty($mode)) {
$uri = $uri->withQuery(... | php | public function getTranslation(
string $project,
string $resource,
string $lang,
string $mode = ''
): ResponseInterface {
$uri = $this->createUri("/api/2/project/$project/resource/$resource/translation/$lang");
if (!empty($mode)) {
$uri = $uri->withQuery(... | [
"public",
"function",
"getTranslation",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
",",
"string",
"$",
"lang",
",",
"string",
"$",
"mode",
"=",
"''",
")",
":",
"ResponseInterface",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"createUri",... | Get translations on a specified resource.
@param string $project The slug for the project to pull from
@param string $resource The slug for the resource to pull from
@param string $lang The language to return the translation for
@param string $mode The mode of the downloaded file
@return ResponseInterface | [
"Get",
"translations",
"on",
"a",
"specified",
"resource",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Translations.php#L25-L38 |
28,574 | BabDev/Transifex-API | src/Connector/Translations.php | Translations.updateTranslation | public function updateTranslation(
string $project,
string $resource,
string $lang,
string $content,
string $type = 'string'
): ResponseInterface {
return $this->updateResource(
$this->createUri("/api/2/project/$project/resource/$resource/translation/$lang... | php | public function updateTranslation(
string $project,
string $resource,
string $lang,
string $content,
string $type = 'string'
): ResponseInterface {
return $this->updateResource(
$this->createUri("/api/2/project/$project/resource/$resource/translation/$lang... | [
"public",
"function",
"updateTranslation",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
",",
"string",
"$",
"lang",
",",
"string",
"$",
"content",
",",
"string",
"$",
"type",
"=",
"'string'",
")",
":",
"ResponseInterface",
"{",
"return",
... | Update the content of a translation within a project.
@param string $project The project the resource is part of
@param string $resource The resource slug within the project
@param string $lang The language to return the translation for
@param string $content The content of the resource, this can either be a str... | [
"Update",
"the",
"content",
"of",
"a",
"translation",
"within",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Translations.php#L51-L63 |
28,575 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getCriteria | public function getCriteria(string $value): array
{
if ('' === trim($value)) {
return [];
}
$fields = $this->getFields();
if (empty($fields)) {
return [];
}
$result = [];
foreach ($fields as $field) {
$criteria = $this->ge... | php | public function getCriteria(string $value): array
{
if ('' === trim($value)) {
return [];
}
$fields = $this->getFields();
if (empty($fields)) {
return [];
}
$result = [];
foreach ($fields as $field) {
$criteria = $this->ge... | [
"public",
"function",
"getCriteria",
"(",
"string",
"$",
"value",
")",
":",
"array",
"{",
"if",
"(",
"''",
"===",
"trim",
"(",
"$",
"value",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"fields",
"=",
"$",
"this",
"->",
"getFields",
"(",
")"... | Prepare basic search query's where statement
@param string $value Search query value
@return mixed[] | [
"Prepare",
"basic",
"search",
"query",
"s",
"where",
"statement"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L76-L98 |
28,576 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getFields | protected function getFields(): array
{
if (empty($this->searchFields)) {
return [];
}
$event = new Event((string)EventName::MODEL_SEARCH_BASIC_SEARCH_FIELDS(), $this, [
'table' => $this->table
]);
EventManager::instance()->dispatch($event);
... | php | protected function getFields(): array
{
if (empty($this->searchFields)) {
return [];
}
$event = new Event((string)EventName::MODEL_SEARCH_BASIC_SEARCH_FIELDS(), $this, [
'table' => $this->table
]);
EventManager::instance()->dispatch($event);
... | [
"protected",
"function",
"getFields",
"(",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"searchFields",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"event",
"=",
"new",
"Event",
"(",
"(",
"string",
")",
"EventName",
"::... | Method that broadcasts an Event to generate the basic search fields.
If the Event result is empty then it falls back to using the display field.
If the display field is a virtual one then if falls back to searchable fields,
using the ones that their type matches the basicSearchFieldTypes list.
@return mixed[] | [
"Method",
"that",
"broadcasts",
"an",
"Event",
"to",
"generate",
"the",
"basic",
"search",
"fields",
".",
"If",
"the",
"Event",
"result",
"is",
"empty",
"then",
"it",
"falls",
"back",
"to",
"using",
"the",
"display",
"field",
".",
"If",
"the",
"display",
... | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L108-L134 |
28,577 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.filterFields | protected function filterFields(array $fields): array
{
// get table columns, aliased
$columns = $this->table->getSchema()->columns();
foreach ($columns as $index => $column) {
$columns[$index] = $this->table->aliasField($column);
}
// filter out virtual fields
... | php | protected function filterFields(array $fields): array
{
// get table columns, aliased
$columns = $this->table->getSchema()->columns();
foreach ($columns as $index => $column) {
$columns[$index] = $this->table->aliasField($column);
}
// filter out virtual fields
... | [
"protected",
"function",
"filterFields",
"(",
"array",
"$",
"fields",
")",
":",
"array",
"{",
"// get table columns, aliased",
"$",
"columns",
"=",
"$",
"this",
"->",
"table",
"->",
"getSchema",
"(",
")",
"->",
"columns",
"(",
")",
";",
"foreach",
"(",
"$"... | Filters basic search fields by removing virtual ones.
@param mixed[] $fields Basic search fields
@return mixed[] | [
"Filters",
"basic",
"search",
"fields",
"by",
"removing",
"virtual",
"ones",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L142-L158 |
28,578 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getDefaultFields | protected function getDefaultFields(): array
{
$result = [];
$types = Options::getBasicSearchFieldTypes();
foreach ($this->searchFields as $field => $properties) {
if (in_array($properties['type'], $types)) {
$result[] = $field;
}
}
r... | php | protected function getDefaultFields(): array
{
$result = [];
$types = Options::getBasicSearchFieldTypes();
foreach ($this->searchFields as $field => $properties) {
if (in_array($properties['type'], $types)) {
$result[] = $field;
}
}
r... | [
"protected",
"function",
"getDefaultFields",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"types",
"=",
"Options",
"::",
"getBasicSearchFieldTypes",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"searchFields",
"as",
"$",
"fie... | Default basic search fields getter.
@return mixed[] | [
"Default",
"basic",
"search",
"fields",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L165-L177 |
28,579 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getFieldCriteria | protected function getFieldCriteria(string $field, string $value): array
{
// not a searchable field
if (!array_key_exists($field, $this->searchFields)) {
return [];
}
// unsupported field type for basic search
$type = $this->searchFields[$field]['type'];
... | php | protected function getFieldCriteria(string $field, string $value): array
{
// not a searchable field
if (!array_key_exists($field, $this->searchFields)) {
return [];
}
// unsupported field type for basic search
$type = $this->searchFields[$field]['type'];
... | [
"protected",
"function",
"getFieldCriteria",
"(",
"string",
"$",
"field",
",",
"string",
"$",
"value",
")",
":",
"array",
"{",
"// not a searchable field",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"searchFields",
")",
")... | Field criteria getter for basic search field.
@param string $field Field name
@param string $value Search query value
@return mixed[] | [
"Field",
"criteria",
"getter",
"for",
"basic",
"search",
"field",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L186-L211 |
28,580 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getFieldValue | protected function getFieldValue(string $field, string $value): array
{
return [
'type' => $this->searchFields[$field]['type'],
'operator' => key($this->searchFields[$field]['operators']),
'value' => $value
];
} | php | protected function getFieldValue(string $field, string $value): array
{
return [
'type' => $this->searchFields[$field]['type'],
'operator' => key($this->searchFields[$field]['operators']),
'value' => $value
];
} | [
"protected",
"function",
"getFieldValue",
"(",
"string",
"$",
"field",
",",
"string",
"$",
"value",
")",
":",
"array",
"{",
"return",
"[",
"'type'",
"=>",
"$",
"this",
"->",
"searchFields",
"[",
"$",
"field",
"]",
"[",
"'type'",
"]",
",",
"'operator'",
... | Field value getter for basic search criteria.
@param string $field Field name
@param string $value Search query value
@return mixed[] | [
"Field",
"value",
"getter",
"for",
"basic",
"search",
"criteria",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L220-L227 |
28,581 | QoboLtd/cakephp-search | src/Utility/BasicSearch.php | BasicSearch.getRelatedFieldValue | protected function getRelatedFieldValue(string $field, string $value): array
{
$table = TableRegistry::get($this->searchFields[$field]['source']);
// avoid infinite recursion
if ($this->table->getAlias() === $table->getAlias()) {
return [];
}
$search = new Searc... | php | protected function getRelatedFieldValue(string $field, string $value): array
{
$table = TableRegistry::get($this->searchFields[$field]['source']);
// avoid infinite recursion
if ($this->table->getAlias() === $table->getAlias()) {
return [];
}
$search = new Searc... | [
"protected",
"function",
"getRelatedFieldValue",
"(",
"string",
"$",
"field",
",",
"string",
"$",
"value",
")",
":",
"array",
"{",
"$",
"table",
"=",
"TableRegistry",
"::",
"get",
"(",
"$",
"this",
"->",
"searchFields",
"[",
"$",
"field",
"]",
"[",
"'sou... | Gets basic search values from Related module.
This method is useful when you do a basic search on a related field,
in which the values are always uuid's. What this method will do is
run a search in the related module (recursively) to fetch and
return the entities IDs matching the search string.
@param string $field F... | [
"Gets",
"basic",
"search",
"values",
"from",
"Related",
"module",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/BasicSearch.php#L241-L278 |
28,582 | QoboLtd/cakephp-search | src/Service/Search.php | Search.addCriteria | public function addCriteria(Criteria $criteria) : void
{
if (! $this->isValidFilter($criteria->getOperator())) {
throw new \RuntimeException(sprintf('Invalid filter provided: %s', $criteria->getOperator()));
}
$this->criteria[] = $criteria;
} | php | public function addCriteria(Criteria $criteria) : void
{
if (! $this->isValidFilter($criteria->getOperator())) {
throw new \RuntimeException(sprintf('Invalid filter provided: %s', $criteria->getOperator()));
}
$this->criteria[] = $criteria;
} | [
"public",
"function",
"addCriteria",
"(",
"Criteria",
"$",
"criteria",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidFilter",
"(",
"$",
"criteria",
"->",
"getOperator",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException"... | Add criteria to Search.
@param \Search\Service\Criteria $criteria Criteria object
@return void
@throws \RuntimeException When invalid filter class is provided | [
"Add",
"criteria",
"to",
"Search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L103-L110 |
28,583 | QoboLtd/cakephp-search | src/Service/Search.php | Search.setConjunction | public function setConjunction(string $conjunction = self::DEFAULT_CONJUNCTION) : void
{
if (! in_array($conjunction, self::CONJUNCTIONS)) {
throw new \RuntimeException(sprintf('Invalid conjunction provided: %s', $conjunction));
}
$this->conjunction = $conjunction;
} | php | public function setConjunction(string $conjunction = self::DEFAULT_CONJUNCTION) : void
{
if (! in_array($conjunction, self::CONJUNCTIONS)) {
throw new \RuntimeException(sprintf('Invalid conjunction provided: %s', $conjunction));
}
$this->conjunction = $conjunction;
} | [
"public",
"function",
"setConjunction",
"(",
"string",
"$",
"conjunction",
"=",
"self",
"::",
"DEFAULT_CONJUNCTION",
")",
":",
"void",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"conjunction",
",",
"self",
"::",
"CONJUNCTIONS",
")",
")",
"{",
"throw",
"new... | Add conjunction to Search.
@param string $conjunction Search conjunction
@return void
@throws \RuntimeException When invalid filter class is provided | [
"Add",
"conjunction",
"to",
"Search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L119-L126 |
28,584 | QoboLtd/cakephp-search | src/Service/Search.php | Search.execute | public function execute() : Query
{
$this->applyFilters();
$this->applySelect();
$this->applyJoins();
$clause = $this->query->clause('where');
// adjust where clause conjunction
if (null !== $clause) {
$this->query->where($clause->setConjunction($this->co... | php | public function execute() : Query
{
$this->applyFilters();
$this->applySelect();
$this->applyJoins();
$clause = $this->query->clause('where');
// adjust where clause conjunction
if (null !== $clause) {
$this->query->where($clause->setConjunction($this->co... | [
"public",
"function",
"execute",
"(",
")",
":",
"Query",
"{",
"$",
"this",
"->",
"applyFilters",
"(",
")",
";",
"$",
"this",
"->",
"applySelect",
"(",
")",
";",
"$",
"this",
"->",
"applyJoins",
"(",
")",
";",
"$",
"clause",
"=",
"$",
"this",
"->",
... | Executes search logic.
@return \Cake\ORM\Query | [
"Executes",
"search",
"logic",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L133-L146 |
28,585 | QoboLtd/cakephp-search | src/Service/Search.php | Search.applyFilters | private function applyFilters() : void
{
foreach ($this->criteria as $criteria) {
$filterClass = $criteria->getOperator();
$filter = new $filterClass(
$this->table->aliasField($criteria->getField()),
$criteria->getValue()
);
$... | php | private function applyFilters() : void
{
foreach ($this->criteria as $criteria) {
$filterClass = $criteria->getOperator();
$filter = new $filterClass(
$this->table->aliasField($criteria->getField()),
$criteria->getValue()
);
$... | [
"private",
"function",
"applyFilters",
"(",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"criteria",
"as",
"$",
"criteria",
")",
"{",
"$",
"filterClass",
"=",
"$",
"criteria",
"->",
"getOperator",
"(",
")",
";",
"$",
"filter",
"=",
"new",
... | Applies filters to the Query.
@return void | [
"Applies",
"filters",
"to",
"the",
"Query",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L164-L176 |
28,586 | QoboLtd/cakephp-search | src/Service/Search.php | Search.applySelect | private function applySelect() : void
{
$group = $this->query->clause('group');
$group = array_filter($group);
if (empty($group)) {
return;
}
$this->query->select($group, true);
$this->query->select([self::GROUP_BY_FIELD => $this->query->func()->count($gr... | php | private function applySelect() : void
{
$group = $this->query->clause('group');
$group = array_filter($group);
if (empty($group)) {
return;
}
$this->query->select($group, true);
$this->query->select([self::GROUP_BY_FIELD => $this->query->func()->count($gr... | [
"private",
"function",
"applySelect",
"(",
")",
":",
"void",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"query",
"->",
"clause",
"(",
"'group'",
")",
";",
"$",
"group",
"=",
"array_filter",
"(",
"$",
"group",
")",
";",
"if",
"(",
"empty",
"(",
"$",... | Adjusts select clause in case a group_by clause is defined.
@return void | [
"Adjusts",
"select",
"clause",
"in",
"case",
"a",
"group_by",
"clause",
"is",
"defined",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L183-L193 |
28,587 | QoboLtd/cakephp-search | src/Service/Search.php | Search.applyJoins | private function applyJoins() : void
{
foreach ($this->getAssociations() as $association) {
switch ($association->type()) {
case Association::MANY_TO_ONE:
$this->query->leftJoinWith($association->getName());
break;
case Ass... | php | private function applyJoins() : void
{
foreach ($this->getAssociations() as $association) {
switch ($association->type()) {
case Association::MANY_TO_ONE:
$this->query->leftJoinWith($association->getName());
break;
case Ass... | [
"private",
"function",
"applyJoins",
"(",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAssociations",
"(",
")",
"as",
"$",
"association",
")",
"{",
"switch",
"(",
"$",
"association",
"->",
"type",
"(",
")",
")",
"{",
"case",
"Associati... | Applies association joins to the Query.
@return void | [
"Applies",
"association",
"joins",
"to",
"the",
"Query",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L200-L215 |
28,588 | QoboLtd/cakephp-search | src/Service/Search.php | Search.getAssociations | private function getAssociations() : array
{
$result = [];
foreach ($this->getQueryFields() as $field) {
$association = $this->getAssociationByField($field);
if (null === $association) {
continue;
}
if (array_key_exists($association->g... | php | private function getAssociations() : array
{
$result = [];
foreach ($this->getQueryFields() as $field) {
$association = $this->getAssociationByField($field);
if (null === $association) {
continue;
}
if (array_key_exists($association->g... | [
"private",
"function",
"getAssociations",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getQueryFields",
"(",
")",
"as",
"$",
"field",
")",
"{",
"$",
"association",
"=",
"$",
"this",
"->",
"getAss... | Get required associations based on current search criteria.
@return mixed[] | [
"Get",
"required",
"associations",
"based",
"on",
"current",
"search",
"criteria",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L222-L239 |
28,589 | QoboLtd/cakephp-search | src/Service/Search.php | Search.getQueryFields | private function getQueryFields() : array
{
$result = [];
foreach ($this->criteria as $criteria) {
$field = $this->table->aliasField($criteria->getField());
if (! in_array($field, $result)) {
$result[] = $field;
}
}
foreach ($this-... | php | private function getQueryFields() : array
{
$result = [];
foreach ($this->criteria as $criteria) {
$field = $this->table->aliasField($criteria->getField());
if (! in_array($field, $result)) {
$result[] = $field;
}
}
foreach ($this-... | [
"private",
"function",
"getQueryFields",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"criteria",
"as",
"$",
"criteria",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"table",
"->",
"aliasField"... | Get search query fields from criteria and select clause.
@return string[] | [
"Get",
"search",
"query",
"fields",
"from",
"criteria",
"and",
"select",
"clause",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L246-L263 |
28,590 | QoboLtd/cakephp-search | src/Service/Search.php | Search.getAssociationByField | private function getAssociationByField(string $field) : ?Association
{
list($name) = explode('.', $this->table->aliasField($field), 2);
if ($name === $this->table->getAlias()) {
return null;
}
if (! $this->table->hasAssociation($name)) {
throw new \RuntimeEx... | php | private function getAssociationByField(string $field) : ?Association
{
list($name) = explode('.', $this->table->aliasField($field), 2);
if ($name === $this->table->getAlias()) {
return null;
}
if (! $this->table->hasAssociation($name)) {
throw new \RuntimeEx... | [
"private",
"function",
"getAssociationByField",
"(",
"string",
"$",
"field",
")",
":",
"?",
"Association",
"{",
"list",
"(",
"$",
"name",
")",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"table",
"->",
"aliasField",
"(",
"$",
"field",
")",
",",... | Retrieves table association by aliased field name.
Example: 'Author.name'
@param string $field Field name
@return \Cake\ORM\Association|null
@throws \RuntimeException When invalid association is found | [
"Retrieves",
"table",
"association",
"by",
"aliased",
"field",
"name",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Search.php#L274-L287 |
28,591 | QoboLtd/cakephp-search | src/Model/Table/SavedSearchesTable.php | SavedSearchesTable.beforeMarshal | public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) : void
{
// @todo this will be removed once saved searches table schema is adjusted
$saved = Hash::get($data, 'content.saved', []);
if (! empty($saved)) {
$data['content']['latest'] = $saved;
... | php | public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) : void
{
// @todo this will be removed once saved searches table schema is adjusted
$saved = Hash::get($data, 'content.saved', []);
if (! empty($saved)) {
$data['content']['latest'] = $saved;
... | [
"public",
"function",
"beforeMarshal",
"(",
"Event",
"$",
"event",
",",
"ArrayObject",
"$",
"data",
",",
"ArrayObject",
"$",
"options",
")",
":",
"void",
"{",
"// @todo this will be removed once saved searches table schema is adjusted",
"$",
"saved",
"=",
"Hash",
"::"... | Structures "content" data to suported format.
@param \Cake\Event\Event $event Event object
@param \ArrayObject $data Request data
@param \ArrayObject $options Marshaller options
@return void | [
"Structures",
"content",
"data",
"to",
"suported",
"format",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Table/SavedSearchesTable.php#L128-L135 |
28,592 | TYPO3-CMS/redirects | Classes/Repository/Demand.php | Demand.createFromRequest | public static function createFromRequest(ServerRequestInterface $request): Demand
{
$page = (int)($request->getQueryParams()['page'] ?? $request->getParsedBody()['page'] ?? 1);
$demand = $request->getQueryParams()['demand'] ?? $request->getParsedBody()['demand'];
if (empty($demand)) {
... | php | public static function createFromRequest(ServerRequestInterface $request): Demand
{
$page = (int)($request->getQueryParams()['page'] ?? $request->getParsedBody()['page'] ?? 1);
$demand = $request->getQueryParams()['demand'] ?? $request->getParsedBody()['demand'];
if (empty($demand)) {
... | [
"public",
"static",
"function",
"createFromRequest",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"Demand",
"{",
"$",
"page",
"=",
"(",
"int",
")",
"(",
"$",
"request",
"->",
"getQueryParams",
"(",
")",
"[",
"'page'",
"]",
"??",
"$",
"request",... | Creates a Demand object from the current request.
@param ServerRequestInterface $request
@return Demand | [
"Creates",
"a",
"Demand",
"object",
"from",
"the",
"current",
"request",
"."
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Repository/Demand.php#L79-L91 |
28,593 | QoboLtd/cakephp-search | src/Service/Criteria.php | Criteria.validate | private function validate(array $data) : void
{
$diff = array_diff(self::REQUIRED_PARAMS, array_keys($data));
if (! empty($diff)) {
throw new \InvalidArgumentException(
sprintf('Search criteria is missing required parameter(s): %s', implode(', ', $diff))
);
... | php | private function validate(array $data) : void
{
$diff = array_diff(self::REQUIRED_PARAMS, array_keys($data));
if (! empty($diff)) {
throw new \InvalidArgumentException(
sprintf('Search criteria is missing required parameter(s): %s', implode(', ', $diff))
);
... | [
"private",
"function",
"validate",
"(",
"array",
"$",
"data",
")",
":",
"void",
"{",
"$",
"diff",
"=",
"array_diff",
"(",
"self",
"::",
"REQUIRED_PARAMS",
",",
"array_keys",
"(",
"$",
"data",
")",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"diff",
... | Validates search criteria.
@param mixed[] $data Search criteria
@return void
@throws \InvalidArgumentException When invalid/incomplete data are provided | [
"Validates",
"search",
"criteria",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Service/Criteria.php#L68-L89 |
28,594 | QoboLtd/cakephp-search | src/Model/Behavior/SearchableBehavior.php | SearchableBehavior.findSearch | public function findSearch(Query $query, array $options) : Query
{
$search = new Search($query, $this->getTable());
$search->setConjunction(Hash::get($options, 'conjunction', Search::DEFAULT_CONJUNCTION));
foreach (Hash::get($options, 'data', []) as $criteria) {
if (! is_array(... | php | public function findSearch(Query $query, array $options) : Query
{
$search = new Search($query, $this->getTable());
$search->setConjunction(Hash::get($options, 'conjunction', Search::DEFAULT_CONJUNCTION));
foreach (Hash::get($options, 'data', []) as $criteria) {
if (! is_array(... | [
"public",
"function",
"findSearch",
"(",
"Query",
"$",
"query",
",",
"array",
"$",
"options",
")",
":",
"Query",
"{",
"$",
"search",
"=",
"new",
"Search",
"(",
"$",
"query",
",",
"$",
"this",
"->",
"getTable",
"(",
")",
")",
";",
"$",
"search",
"->... | Search finder method.
@param \Cake\ORM\Query $query The query object to apply the finder options to
@param mixed[] $options List of options to pass to the finder
@return \Cake\ORM\Query | [
"Search",
"finder",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Behavior/SearchableBehavior.php#L46-L64 |
28,595 | php-enqueue/stomp | BufferedStompClient.php | BufferedStompClient.readMessageFrame | public function readMessageFrame(string $subscriptionId, int $timeout): ?Frame
{
// pop up frame from the buffer
if (isset($this->buffer[$subscriptionId]) && ($frame = array_shift($this->buffer[$subscriptionId]))) {
--$this->currentBufferSize;
return $frame;
}
... | php | public function readMessageFrame(string $subscriptionId, int $timeout): ?Frame
{
// pop up frame from the buffer
if (isset($this->buffer[$subscriptionId]) && ($frame = array_shift($this->buffer[$subscriptionId]))) {
--$this->currentBufferSize;
return $frame;
}
... | [
"public",
"function",
"readMessageFrame",
"(",
"string",
"$",
"subscriptionId",
",",
"int",
"$",
"timeout",
")",
":",
"?",
"Frame",
"{",
"// pop up frame from the buffer",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"buffer",
"[",
"$",
"subscriptionId",
"]",
... | Timeout is in milliseconds. | [
"Timeout",
"is",
"in",
"milliseconds",
"."
] | b5c5742ba6c863bcc38396cc38110aa829e9336d | https://github.com/php-enqueue/stomp/blob/b5c5742ba6c863bcc38396cc38110aa829e9336d/BufferedStompClient.php#L53-L104 |
28,596 | BabDev/Transifex-API | src/Connector/Languages.php | Languages.createLanguage | public function createLanguage(
string $slug,
string $langCode,
array $coordinators,
array $options = [],
bool $skipInvalidUsername = false
): ResponseInterface {
// Make sure the $coordinators array is not empty
if (!\count($coordinators)) {
throw... | php | public function createLanguage(
string $slug,
string $langCode,
array $coordinators,
array $options = [],
bool $skipInvalidUsername = false
): ResponseInterface {
// Make sure the $coordinators array is not empty
if (!\count($coordinators)) {
throw... | [
"public",
"function",
"createLanguage",
"(",
"string",
"$",
"slug",
",",
"string",
"$",
"langCode",
",",
"array",
"$",
"coordinators",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"bool",
"$",
"skipInvalidUsername",
"=",
"false",
")",
":",
"ResponseIn... | Create a language for a project.
@param string $slug The slug for the project
@param string $langCode The language code for the new language
@param string[] $coordinators An array of coordinators for the language
@param array $options Optional additional params to se... | [
"Create",
"a",
"language",
"for",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Languages.php#L28-L66 |
28,597 | BabDev/Transifex-API | src/Connector/Languages.php | Languages.deleteLanguage | public function deleteLanguage(string $project, string $langCode): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/language/$langCode/")));
} | php | public function deleteLanguage(string $project, string $langCode): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/language/$langCode/")));
} | [
"public",
"function",
"deleteLanguage",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"langCode",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"createRequest",
"(",
"'DELETE'",
"... | Delete a language within a project.
@param string $project The project to retrieve details for
@param string $langCode The language code to retrieve details for
@return ResponseInterface | [
"Delete",
"a",
"language",
"within",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Languages.php#L76-L79 |
28,598 | BabDev/Transifex-API | src/Connector/Languages.php | Languages.getLanguages | public function getLanguages(string $project): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/project/$project/languages/")));
} | php | public function getLanguages(string $project): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/project/$project/languages/")));
} | [
"public",
"function",
"getLanguages",
"(",
"string",
"$",
"project",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"createRequest",
"(",
"'GET'",
",",
"$",
"this",
"->",
"createUri",
... | Get a list of languages for a specified project.
@param string $project The project to retrieve details for
@return ResponseInterface | [
"Get",
"a",
"list",
"of",
"languages",
"for",
"a",
"specified",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Languages.php#L121-L124 |
28,599 | BabDev/Transifex-API | src/Connector/Languages.php | Languages.updateCoordinators | public function updateCoordinators(
string $project,
string $langCode,
array $coordinators,
bool $skipInvalidUsername = false
): ResponseInterface {
return $this->updateTeam($project, $langCode, $coordinators, $skipInvalidUsername, 'coordinators');
} | php | public function updateCoordinators(
string $project,
string $langCode,
array $coordinators,
bool $skipInvalidUsername = false
): ResponseInterface {
return $this->updateTeam($project, $langCode, $coordinators, $skipInvalidUsername, 'coordinators');
} | [
"public",
"function",
"updateCoordinators",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"langCode",
",",
"array",
"$",
"coordinators",
",",
"bool",
"$",
"skipInvalidUsername",
"=",
"false",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->"... | Update the coordinators for a language team in a project.
@param string $project The project to retrieve details for
@param string $langCode The language code to retrieve details for
@param string[] $coordinators An array of coordinators for the language
@param bool $skipInvalidUs... | [
"Update",
"the",
"coordinators",
"for",
"a",
"language",
"team",
"in",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Languages.php#L162-L169 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.