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,400 | novaway/BehatCommonContext | src/Context/FormContext.php | FormContext.iFillInFieldWithoutLoosingFocus | public function iFillInFieldWithoutLoosingFocus($field, $value)
{
$driver = $this->getSession()->getDriver();
if ('Behat\Mink\Driver\Selenium2Driver' != get_class($driver)) {
$field = $this->fixStepArgument($field);
$value = $this->fixStepArgument($value);
$this-... | php | public function iFillInFieldWithoutLoosingFocus($field, $value)
{
$driver = $this->getSession()->getDriver();
if ('Behat\Mink\Driver\Selenium2Driver' != get_class($driver)) {
$field = $this->fixStepArgument($field);
$value = $this->fixStepArgument($value);
$this-... | [
"public",
"function",
"iFillInFieldWithoutLoosingFocus",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"driver",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getDriver",
"(",
")",
";",
"if",
"(",
"'Behat\\Mink\\Driver\\Selenium2Driver'",
"!=",... | Fills in form field with specified id|name|label|value without unfocus field
@When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)" without loosing focus$/
@When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)" without loosing focus$/ | [
"Fills",
"in",
"form",
"field",
"with",
"specified",
"id|name|label|value",
"without",
"unfocus",
"field"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/FormContext.php#L13-L32 |
28,401 | novaway/BehatCommonContext | src/Context/Select2Context.php | Select2Context.iFillInSelect2Field | public function iFillInSelect2Field($field, $value)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->selectValue($page, $field, $value, $this->timeout);
} | php | public function iFillInSelect2Field($field, $value)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->selectValue($page, $field, $value, $this->timeout);
} | [
"public",
"function",
"iFillInSelect2Field",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
";",
"$",
"this",
"->",
"openField",
"(",
"$",
"page",
",",
"$",
"f... | Fills in Select2 field with specified
@When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
@When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ | [
"Fills",
"in",
"Select2",
"field",
"with",
"specified"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/Select2Context.php#L30-L36 |
28,402 | novaway/BehatCommonContext | src/Context/Select2Context.php | Select2Context.iFillInSelect2FieldWaitUntilResultsAreLoaded | public function iFillInSelect2FieldWaitUntilResultsAreLoaded($field, $value, $time)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->selectValue($page, $field, $value, $time);
} | php | public function iFillInSelect2FieldWaitUntilResultsAreLoaded($field, $value, $time)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->selectValue($page, $field, $value, $time);
} | [
"public",
"function",
"iFillInSelect2FieldWaitUntilResultsAreLoaded",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"time",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
";",
"$",
"this",
"->",
"openF... | Fills in Select2 field with specified and wait for results
@When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)" and wait (?P<time>(?:[^"]|\\")*) seconds until results are loaded$/
@When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)" and wait (?P<... | [
"Fills",
"in",
"Select2",
"field",
"with",
"specified",
"and",
"wait",
"for",
"results"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/Select2Context.php#L44-L50 |
28,403 | novaway/BehatCommonContext | src/Context/Select2Context.php | Select2Context.iFillInSelect2InputWithAndSelect | public function iFillInSelect2InputWithAndSelect($field, $value, $entry)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->fillSearchField($page, $field, $value);
$this->selectValue($page, $field, $entry, $this->timeout);
} | php | public function iFillInSelect2InputWithAndSelect($field, $value, $entry)
{
$page = $this->getSession()->getPage();
$this->openField($page, $field);
$this->fillSearchField($page, $field, $value);
$this->selectValue($page, $field, $entry, $this->timeout);
} | [
"public",
"function",
"iFillInSelect2InputWithAndSelect",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"entry",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
";",
"$",
"this",
"->",
"openField",
"(... | Fill Select2 input field and select a value
@When /^(?:|I )fill in select2 input "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)" and select "(?P<entry>(?:[^"]|\\")*)"$/ | [
"Fill",
"Select2",
"input",
"field",
"and",
"select",
"a",
"value"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/Select2Context.php#L70-L77 |
28,404 | novaway/BehatCommonContext | src/Context/Select2Context.php | Select2Context.waitForLoadingResults | private function waitForLoadingResults($time)
{
for ($i = 0; $i < $time; $i++) {
if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) {
return;
}
sleep(1);
}
} | php | private function waitForLoadingResults($time)
{
for ($i = 0; $i < $time; $i++) {
if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) {
return;
}
sleep(1);
}
} | [
"private",
"function",
"waitForLoadingResults",
"(",
"$",
"time",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"time",
";",
"$",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPag... | Wait the end of fetching Select2 results
@param int $time Time to wait in seconds | [
"Wait",
"the",
"end",
"of",
"fetching",
"Select2",
"results"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/Select2Context.php#L175-L184 |
28,405 | novaway/BehatCommonContext | src/Context/FormstoneContext.php | FormstoneContext.selectValue | private function selectValue($component, $field, $value)
{
$page = $this->getSession()->getPage();
$this->openComponent($page, $component, $field);
$this->selectComponentValue($page, $component, $field, $value);
} | php | private function selectValue($component, $field, $value)
{
$page = $this->getSession()->getPage();
$this->openComponent($page, $component, $field);
$this->selectComponentValue($page, $component, $field, $value);
} | [
"private",
"function",
"selectValue",
"(",
"$",
"component",
",",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
";",
"$",
"this",
"->",
"openComponent",
"(",
"$",
... | Select value in component
@param string $component
@param string $field
@param string $value
@throws \Exception | [
"Select",
"value",
"in",
"component"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/FormstoneContext.php#L43-L49 |
28,406 | novaway/BehatCommonContext | src/Context/FormstoneContext.php | FormstoneContext.openComponent | private function openComponent(DocumentElement $page, $component, $field)
{
$select = $page->find('css', sprintf('#%s', $field));
if (!$select) {
throw new \Exception(sprintf('No select "%s" found', $field));
}
$fieldName = sprintf('.fs-%1$s .fs-%1$s-selected', $componen... | php | private function openComponent(DocumentElement $page, $component, $field)
{
$select = $page->find('css', sprintf('#%s', $field));
if (!$select) {
throw new \Exception(sprintf('No select "%s" found', $field));
}
$fieldName = sprintf('.fs-%1$s .fs-%1$s-selected', $componen... | [
"private",
"function",
"openComponent",
"(",
"DocumentElement",
"$",
"page",
",",
"$",
"component",
",",
"$",
"field",
")",
"{",
"$",
"select",
"=",
"$",
"page",
"->",
"find",
"(",
"'css'",
",",
"sprintf",
"(",
"'#%s'",
",",
"$",
"field",
")",
")",
"... | Open component choice list
@param DocumentElement $page
@param string $component
@param string $field
@throws \Exception | [
"Open",
"component",
"choice",
"list"
] | b5349bd6a36c0e0ca71465a5349f8d68c1d1e102 | https://github.com/novaway/BehatCommonContext/blob/b5349bd6a36c0e0ca71465a5349f8d68c1d1e102/src/Context/FormstoneContext.php#L59-L73 |
28,407 | graphaware/neo4j-php-ogm | src/Metadata/NodeEntityMetadata.php | NodeEntityMetadata.getNonLazyRelationships | public function getNonLazyRelationships()
{
$rels = [];
foreach ($this->relationships as $relationship) {
if (!$relationship->isLazy()) {
$rels[] = $relationship;
}
}
return $rels;
} | php | public function getNonLazyRelationships()
{
$rels = [];
foreach ($this->relationships as $relationship) {
if (!$relationship->isLazy()) {
$rels[] = $relationship;
}
}
return $rels;
} | [
"public",
"function",
"getNonLazyRelationships",
"(",
")",
"{",
"$",
"rels",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"relationships",
"as",
"$",
"relationship",
")",
"{",
"if",
"(",
"!",
"$",
"relationship",
"->",
"isLazy",
"(",
")",
")"... | Returns non-lazy relationships.
Note that currently relationships that are not of type "collection" are considered non-lazy.
@return RelationshipMetadata[] | [
"Returns",
"non",
"-",
"lazy",
"relationships",
".",
"Note",
"that",
"currently",
"relationships",
"that",
"are",
"not",
"of",
"type",
"collection",
"are",
"considered",
"non",
"-",
"lazy",
"."
] | 390c0413582933ffae9597edfa57d6df6c570b03 | https://github.com/graphaware/neo4j-php-ogm/blob/390c0413582933ffae9597edfa57d6df6c570b03/src/Metadata/NodeEntityMetadata.php#L142-L152 |
28,408 | graphaware/neo4j-php-ogm | src/Persister/EntityPersister.php | EntityPersister.refresh | public function refresh($id, $entity)
{
$label = $this->classMetadata->getLabel();
$query = sprintf('MATCH (n:%s) WHERE id(n) = {%s} RETURN n', $label, 'id');
$result = $this->entityManager->getDatabaseDriver()->run($query, ['id' => $id]);
if ($result->size() > 0) {
$nod... | php | public function refresh($id, $entity)
{
$label = $this->classMetadata->getLabel();
$query = sprintf('MATCH (n:%s) WHERE id(n) = {%s} RETURN n', $label, 'id');
$result = $this->entityManager->getDatabaseDriver()->run($query, ['id' => $id]);
if ($result->size() > 0) {
$nod... | [
"public",
"function",
"refresh",
"(",
"$",
"id",
",",
"$",
"entity",
")",
"{",
"$",
"label",
"=",
"$",
"this",
"->",
"classMetadata",
"->",
"getLabel",
"(",
")",
";",
"$",
"query",
"=",
"sprintf",
"(",
"'MATCH (n:%s) WHERE id(n) = {%s} RETURN n'",
",",
"$"... | Refreshes a managed entity.
@param int $id
@param object $entity The entity to refresh | [
"Refreshes",
"a",
"managed",
"entity",
"."
] | 390c0413582933ffae9597edfa57d6df6c570b03 | https://github.com/graphaware/neo4j-php-ogm/blob/390c0413582933ffae9597edfa57d6df6c570b03/src/Persister/EntityPersister.php#L142-L152 |
28,409 | graphaware/neo4j-php-ogm | src/UnitOfWork.php | UnitOfWork.getOriginalEntityState | public function getOriginalEntityState($id)
{
if (isset($this->entityStateReferences[$id])) {
return $this->entityStateReferences[$id];
}
return null;
} | php | public function getOriginalEntityState($id)
{
if (isset($this->entityStateReferences[$id])) {
return $this->entityStateReferences[$id];
}
return null;
} | [
"public",
"function",
"getOriginalEntityState",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entityStateReferences",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"entityStateReferences",
"[",
"$",
"id",
"]",
... | Get the original state of an entity when it was loaded from the database.
@param int $id
@return object|null | [
"Get",
"the",
"original",
"state",
"of",
"an",
"entity",
"when",
"it",
"was",
"loaded",
"from",
"the",
"database",
"."
] | 390c0413582933ffae9597edfa57d6df6c570b03 | https://github.com/graphaware/neo4j-php-ogm/blob/390c0413582933ffae9597edfa57d6df6c570b03/src/UnitOfWork.php#L791-L798 |
28,410 | BabDev/Transifex-API | src/Connector/Projects.php | Projects.buildProjectRequest | private function buildProjectRequest(array $options): array
{
$data = [];
// Valid options to check
$validOptions = [
'long_description',
'private',
'homepage',
'trans_instructions',
'tags',
'maintainers',
'... | php | private function buildProjectRequest(array $options): array
{
$data = [];
// Valid options to check
$validOptions = [
'long_description',
'private',
'homepage',
'trans_instructions',
'tags',
'maintainers',
'... | [
"private",
"function",
"buildProjectRequest",
"(",
"array",
"$",
"options",
")",
":",
"array",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"// Valid options to check",
"$",
"validOptions",
"=",
"[",
"'long_description'",
",",
"'private'",
",",
"'homepage'",
",",
"'t... | Build the data array to send with create and update requests.
@param array $options Optional additional params to send with the request
@return array | [
"Build",
"the",
"data",
"array",
"to",
"send",
"with",
"create",
"and",
"update",
"requests",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Projects.php#L22-L58 |
28,411 | BabDev/Transifex-API | src/Connector/Projects.php | Projects.checkLicense | private function checkLicense(string $license): void
{
$accepted = ['proprietary', 'permissive_open_source', 'other_open_source'];
// Ensure the license option is an allowed value
if (!\in_array($license, $accepted)) {
throw new \InvalidArgumentException(
\sprint... | php | private function checkLicense(string $license): void
{
$accepted = ['proprietary', 'permissive_open_source', 'other_open_source'];
// Ensure the license option is an allowed value
if (!\in_array($license, $accepted)) {
throw new \InvalidArgumentException(
\sprint... | [
"private",
"function",
"checkLicense",
"(",
"string",
"$",
"license",
")",
":",
"void",
"{",
"$",
"accepted",
"=",
"[",
"'proprietary'",
",",
"'permissive_open_source'",
",",
"'other_open_source'",
"]",
";",
"// Ensure the license option is an allowed value",
"if",
"(... | Checks that a license is an accepted value.
@param string $license The license to check
@throws \InvalidArgumentException | [
"Checks",
"that",
"a",
"license",
"is",
"an",
"accepted",
"value",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Projects.php#L67-L81 |
28,412 | BabDev/Transifex-API | src/Connector/Projects.php | Projects.getOrganizationProjects | public function getOrganizationProjects(string $organization): ResponseInterface
{
// This API endpoint uses the newer `api.transifex.com` subdomain, only change if the default www was given
$currentBaseUri = $this->getOption('base_uri');
if (!$currentBaseUri || $currentBaseUri === 'https:/... | php | public function getOrganizationProjects(string $organization): ResponseInterface
{
// This API endpoint uses the newer `api.transifex.com` subdomain, only change if the default www was given
$currentBaseUri = $this->getOption('base_uri');
if (!$currentBaseUri || $currentBaseUri === 'https:/... | [
"public",
"function",
"getOrganizationProjects",
"(",
"string",
"$",
"organization",
")",
":",
"ResponseInterface",
"{",
"// This API endpoint uses the newer `api.transifex.com` subdomain, only change if the default www was given",
"$",
"currentBaseUri",
"=",
"$",
"this",
"->",
"... | Get a list of projects belonging to an organization.
@return ResponseInterface | [
"Get",
"a",
"list",
"of",
"projects",
"belonging",
"to",
"an",
"organization",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Projects.php#L147-L161 |
28,413 | QoboLtd/cakephp-search | src/Widgets/Reports/BaseReportGraphs.php | BaseReportGraphs.setContainerId | public function setContainerId(array $data = []) : void
{
$config = empty($data) ? $this->getConfig() : $data;
$this->containerId = self::GRAPH_PREFIX . $config['slug'];
} | php | public function setContainerId(array $data = []) : void
{
$config = empty($data) ? $this->getConfig() : $data;
$this->containerId = self::GRAPH_PREFIX . $config['slug'];
} | [
"public",
"function",
"setContainerId",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
":",
"void",
"{",
"$",
"config",
"=",
"empty",
"(",
"$",
"data",
")",
"?",
"$",
"this",
"->",
"getConfig",
"(",
")",
":",
"$",
"data",
";",
"$",
"this",
"->",
... | setContainerId method.
Sets the placeholder unique identifier for
the widget.
@param mixed[] $data of the config.
@return void | [
"setContainerId",
"method",
".",
"Sets",
"the",
"placeholder",
"unique",
"identifier",
"for",
"the",
"widget",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/Reports/BaseReportGraphs.php#L71-L76 |
28,414 | QoboLtd/cakephp-search | src/Widgets/Reports/BaseReportGraphs.php | BaseReportGraphs.validate | public function validate(array $data = []) : array
{
$validated = false;
$errors = [];
if (empty($this->requiredFields)) {
$errors[] = "Missing requiredFields in the report object";
}
foreach ($this->requiredFields as $field) {
if (!isset($data['info... | php | public function validate(array $data = []) : array
{
$validated = false;
$errors = [];
if (empty($this->requiredFields)) {
$errors[] = "Missing requiredFields in the report object";
}
foreach ($this->requiredFields as $field) {
if (!isset($data['info... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"validated",
"=",
"false",
";",
"$",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"requiredFields",
")",
")",
"{... | validate method.
Checks all the required fields of the report if any.
@param array $data with report configuration
@return mixed[] result of validation | [
"validate",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/Reports/BaseReportGraphs.php#L147-L174 |
28,415 | QoboLtd/cakephp-search | src/Widgets/Reports/BaseReportGraphs.php | BaseReportGraphs.getChartColors | public function getChartColors(int $count, string $myString, bool $shade = true) : array
{
$grad = [];
// Generate first color
if ($shade && $count > 0) {
$color = substr(dechex(crc32($myString)), 0, 6);
list($r, $g, $b) = array_map(function ($n) {
re... | php | public function getChartColors(int $count, string $myString, bool $shade = true) : array
{
$grad = [];
// Generate first color
if ($shade && $count > 0) {
$color = substr(dechex(crc32($myString)), 0, 6);
list($r, $g, $b) = array_map(function ($n) {
re... | [
"public",
"function",
"getChartColors",
"(",
"int",
"$",
"count",
",",
"string",
"$",
"myString",
",",
"bool",
"$",
"shade",
"=",
"true",
")",
":",
"array",
"{",
"$",
"grad",
"=",
"[",
"]",
";",
"// Generate first color",
"if",
"(",
"$",
"shade",
"&&",... | Generate an array whit the colors for the chars.
@param int $count How many element in the array.
@param string $myString The color have to be calculated on a
fix string to be constant in every refresh.
@param bool $shade Shade the default color with another
generated one. If false, the colors will be... | [
"Generate",
"an",
"array",
"whit",
"the",
"colors",
"for",
"the",
"chars",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Widgets/Reports/BaseReportGraphs.php#L199-L235 |
28,416 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Subscription/Standard.php | Standard.delete | public function delete( ServerRequestInterface $request, ResponseInterface $response )
{
$view = $this->getView();
try
{
$cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'subscription' );
$view->items = $cntl->cancel( $view->param( 'id' ) );
$view->total = 1;
$status = 200;
}
... | php | public function delete( ServerRequestInterface $request, ResponseInterface $response )
{
$view = $this->getView();
try
{
$cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'subscription' );
$view->items = $cntl->cancel( $view->param( 'id' ) );
$view->total = 1;
$status = 200;
}
... | [
"public",
"function",
"delete",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"try",
"{",
"$",
"cntl",
"=",
"\\",
"Aimeos",
"\\",
"Contro... | Cancels the subscription
@param \Psr\Http\Message\ServerRequestInterface $request Request object
@param \Psr\Http\Message\ResponseInterface $response Response object
@return \Psr\Http\Message\ResponseInterface Modified response object | [
"Cancels",
"the",
"subscription"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Subscription/Standard.php#L34-L64 |
28,417 | mmoreram/ControllerExtraBundle | ControllerExtraBundle.php | ControllerExtraBundle.registerAnnotations | private function registerAnnotations(array $annotations)
{
$kernel = $this
->container
->get('kernel');
foreach ($annotations as $annotation) {
AnnotationRegistry::registerFile($kernel
->locateResource($annotation)
);
}
} | php | private function registerAnnotations(array $annotations)
{
$kernel = $this
->container
->get('kernel');
foreach ($annotations as $annotation) {
AnnotationRegistry::registerFile($kernel
->locateResource($annotation)
);
}
} | [
"private",
"function",
"registerAnnotations",
"(",
"array",
"$",
"annotations",
")",
"{",
"$",
"kernel",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'kernel'",
")",
";",
"foreach",
"(",
"$",
"annotations",
"as",
"$",
"annotation",
")",
"{",
"... | Register annotations.
@param string[] Annotations | [
"Register",
"annotations",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/ControllerExtraBundle.php#L81-L92 |
28,418 | BabDev/Transifex-API | src/ApiConnector.php | ApiConnector.createAuthorizationHeader | protected function createAuthorizationHeader(): string
{
$username = $this->getOption('api.username');
$password = $this->getOption('api.password');
// The API requires HTTP Basic Authentication, we can't proceed without credentials
if ($username === null || $password === null) {
... | php | protected function createAuthorizationHeader(): string
{
$username = $this->getOption('api.username');
$password = $this->getOption('api.password');
// The API requires HTTP Basic Authentication, we can't proceed without credentials
if ($username === null || $password === null) {
... | [
"protected",
"function",
"createAuthorizationHeader",
"(",
")",
":",
"string",
"{",
"$",
"username",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'api.username'",
")",
";",
"$",
"password",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'api.password'",
")",
";",
... | Creates the Authorization header for the request
@return string
@throws \InvalidArgumentException if credentials are not set | [
"Creates",
"the",
"Authorization",
"header",
"for",
"the",
"request"
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/ApiConnector.php#L81-L92 |
28,419 | BabDev/Transifex-API | src/ApiConnector.php | ApiConnector.createRequest | protected function createRequest(string $method, UriInterface $uri): RequestInterface
{
$request = $this->requestFactory->createRequest($method, $uri);
return $request->withHeader('Authorization', $this->createAuthorizationHeader());
} | php | protected function createRequest(string $method, UriInterface $uri): RequestInterface
{
$request = $this->requestFactory->createRequest($method, $uri);
return $request->withHeader('Authorization', $this->createAuthorizationHeader());
} | [
"protected",
"function",
"createRequest",
"(",
"string",
"$",
"method",
",",
"UriInterface",
"$",
"uri",
")",
":",
"RequestInterface",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"requestFactory",
"->",
"createRequest",
"(",
"$",
"method",
",",
"$",
"uri",
... | Create a Request object for the given URI
This method will also set the Authorization header for the request
@param string $method
@param UriInterface $uri
@return RequestInterface | [
"Create",
"a",
"Request",
"object",
"for",
"the",
"given",
"URI"
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/ApiConnector.php#L104-L109 |
28,420 | BabDev/Transifex-API | src/ApiConnector.php | ApiConnector.createUri | protected function createUri(string $path): UriInterface
{
$baseUrl = $this->getOption('base_uri', 'https://www.transifex.com');
return $this->uriFactory->createUri($baseUrl . $path);
} | php | protected function createUri(string $path): UriInterface
{
$baseUrl = $this->getOption('base_uri', 'https://www.transifex.com');
return $this->uriFactory->createUri($baseUrl . $path);
} | [
"protected",
"function",
"createUri",
"(",
"string",
"$",
"path",
")",
":",
"UriInterface",
"{",
"$",
"baseUrl",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'base_uri'",
",",
"'https://www.transifex.com'",
")",
";",
"return",
"$",
"this",
"->",
"uriFactory",
... | Create a Uri object for the path
@param string $path
@return UriInterface | [
"Create",
"a",
"Uri",
"object",
"for",
"the",
"path"
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/ApiConnector.php#L118-L123 |
28,421 | BabDev/Transifex-API | src/ApiConnector.php | ApiConnector.updateResource | protected function updateResource(UriInterface $uri, string $content, string $type): ResponseInterface
{
// Verify the content type is allowed
if (!\in_array($type, ['string', 'file'])) {
throw new \InvalidArgumentException('The content type must be specified as file or string.');
... | php | protected function updateResource(UriInterface $uri, string $content, string $type): ResponseInterface
{
// Verify the content type is allowed
if (!\in_array($type, ['string', 'file'])) {
throw new \InvalidArgumentException('The content type must be specified as file or string.');
... | [
"protected",
"function",
"updateResource",
"(",
"UriInterface",
"$",
"uri",
",",
"string",
"$",
"content",
",",
"string",
"$",
"type",
")",
":",
"ResponseInterface",
"{",
"// Verify the content type is allowed",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"type"... | Update an API endpoint with resource content.
@param UriInterface $uri URI object representing the API path to request
@param string $content The content of the resource, this can either be a string of data or a file path
@param string $type The type of content in the $content variable, this should ... | [
"Update",
"an",
"API",
"endpoint",
"with",
"resource",
"content",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/ApiConnector.php#L164-L191 |
28,422 | mitchdav/st-george-ipg | src/Client.php | Client.purchase | public function purchase($amount, $cardNumber, $month, $year, $cvc = NULL, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_PURCHASE)
->setTotalA... | php | public function purchase($amount, $cardNumber, $month, $year, $cvc = NULL, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_PURCHASE)
->setTotalA... | [
"public",
"function",
"purchase",
"(",
"$",
"amount",
",",
"$",
"cardNumber",
",",
"$",
"month",
",",
"$",
"year",
",",
"$",
"cvc",
"=",
"NULL",
",",
"$",
"clientReference",
"=",
"NULL",
",",
"$",
"comment",
"=",
"NULL",
",",
"$",
"description",
"=",... | Create a purchase request.
@param $amount
@param $cardNumber
@param $month
@param $year
@param null $cvc
@param null $clientReference
@param null $comment
@param null $description
@param null $cardHolderName
@param null $taxAmount
@return \StGeorgeIPG\Request | [
"Create",
"a",
"purchase",
"request",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L157-L173 |
28,423 | mitchdav/st-george-ipg | src/Client.php | Client.refund | public function refund($amount, $originalTransactionReference, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_REFUND)
->setTotalAmount($amount)... | php | public function refund($amount, $originalTransactionReference, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_REFUND)
->setTotalAmount($amount)... | [
"public",
"function",
"refund",
"(",
"$",
"amount",
",",
"$",
"originalTransactionReference",
",",
"$",
"clientReference",
"=",
"NULL",
",",
"$",
"comment",
"=",
"NULL",
",",
"$",
"description",
"=",
"NULL",
",",
"$",
"cardHolderName",
"=",
"NULL",
",",
"$... | Create a refund request.
@param $amount
@param $originalTransactionReference
@param null $clientReference
@param null $comment
@param null $description
@param null $cardHolderName
@param null $taxAmount
@return \StGeorgeIPG\Request | [
"Create",
"a",
"refund",
"request",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L188-L202 |
28,424 | mitchdav/st-george-ipg | src/Client.php | Client.completion | public function completion($amount, $originalTransactionReference, $authorisationNumber, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_COMPLETION)
... | php | public function completion($amount, $originalTransactionReference, $authorisationNumber, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
{
$request = Request::createFromClient($this);
$request->setTransactionType(Request::TRANSACTION_TYPE_COMPLETION)
... | [
"public",
"function",
"completion",
"(",
"$",
"amount",
",",
"$",
"originalTransactionReference",
",",
"$",
"authorisationNumber",
",",
"$",
"clientReference",
"=",
"NULL",
",",
"$",
"comment",
"=",
"NULL",
",",
"$",
"description",
"=",
"NULL",
",",
"$",
"ca... | Create a completion request.
@param $amount
@param $originalTransactionReference
@param $authorisationNumber
@param null $clientReference
@param null $comment
@param null $description
@param null $cardHolderName
@param null $taxAmount
@return \StGeorgeIPG\Request | [
"Create",
"a",
"completion",
"request",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L252-L267 |
28,425 | mitchdav/st-george-ipg | src/Client.php | Client.status | public function status($transactionReference)
{
$request = Request::createFromClient($this, FALSE);
$request->setTransactionType(Request::TRANSACTION_TYPE_STATUS)
->setTransactionReference($transactionReference);
return $request;
} | php | public function status($transactionReference)
{
$request = Request::createFromClient($this, FALSE);
$request->setTransactionType(Request::TRANSACTION_TYPE_STATUS)
->setTransactionReference($transactionReference);
return $request;
} | [
"public",
"function",
"status",
"(",
"$",
"transactionReference",
")",
"{",
"$",
"request",
"=",
"Request",
"::",
"createFromClient",
"(",
"$",
"this",
",",
"FALSE",
")",
";",
"$",
"request",
"->",
"setTransactionType",
"(",
"Request",
"::",
"TRANSACTION_TYPE_... | Create a status request.
@param $transactionReference
@return \StGeorgeIPG\Request | [
"Create",
"a",
"status",
"request",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L276-L284 |
28,426 | mitchdav/st-george-ipg | src/Client.php | Client.getResponse | public function getResponse(Request $request, $maxTries = 3)
{
$request->validate();
$response = $this->getProvider()
->getResponse($request, $canSafelyTryAgain);
if ($canSafelyTryAgain) {
if ($response->getTransactionReference() !== NULL) {
if ($maxTries > 0) {
$response = $this... | php | public function getResponse(Request $request, $maxTries = 3)
{
$request->validate();
$response = $this->getProvider()
->getResponse($request, $canSafelyTryAgain);
if ($canSafelyTryAgain) {
if ($response->getTransactionReference() !== NULL) {
if ($maxTries > 0) {
$response = $this... | [
"public",
"function",
"getResponse",
"(",
"Request",
"$",
"request",
",",
"$",
"maxTries",
"=",
"3",
")",
"{",
"$",
"request",
"->",
"validate",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"getProvider",
"(",
")",
"->",
"getResponse",
"(",
... | Get a response for the given request, following the flow diagram provided by St.George.
@param \StGeorgeIPG\Request $request
@param integer $maxTries
@return \StGeorgeIPG\Response
@throws \StGeorgeIPG\Exceptions\TransactionFailedException
@throws \StGeorgeIPG\Exceptions\TransactionInProgressException | [
"Get",
"a",
"response",
"for",
"the",
"given",
"request",
"following",
"the",
"flow",
"diagram",
"provided",
"by",
"St",
".",
"George",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L296-L332 |
28,427 | mitchdav/st-george-ipg | src/Client.php | Client.execute | public function execute(Request $request, $maxTries = 3)
{
try {
$response = $this->getResponse($request, $maxTries);
return $this->validateResponse($response);
} catch (TransactionInProgressException $ex) {
throw new TransactionInProgressException($ex->getRequest(), $ex->getResponse(), $maxTries); // Th... | php | public function execute(Request $request, $maxTries = 3)
{
try {
$response = $this->getResponse($request, $maxTries);
return $this->validateResponse($response);
} catch (TransactionInProgressException $ex) {
throw new TransactionInProgressException($ex->getRequest(), $ex->getResponse(), $maxTries); // Th... | [
"public",
"function",
"execute",
"(",
"Request",
"$",
"request",
",",
"$",
"maxTries",
"=",
"3",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(",
"$",
"request",
",",
"$",
"maxTries",
")",
";",
"return",
"$",
"this",... | Get the response, and then pass it to the validator.
@param \StGeorgeIPG\Request $request
@param integer $maxTries
@return \StGeorgeIPG\Response
@throws \StGeorgeIPG\Exceptions\TransactionInProgressException | [
"Get",
"the",
"response",
"and",
"then",
"pass",
"it",
"to",
"the",
"validator",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Client.php#L344-L353 |
28,428 | mmoreram/ControllerExtraBundle | Resolver/FormAnnotationResolver.php | FormAnnotationResolver.getBuiltObject | private function getBuiltObject(
Request $request,
FormFactoryInterface $formFactory,
CreateForm $annotation,
string $parameterClass,
AbstractType $type
) {
/**
* Checks if parameter typehinting is AbstractType
* In this case, form type as defined me... | php | private function getBuiltObject(
Request $request,
FormFactoryInterface $formFactory,
CreateForm $annotation,
string $parameterClass,
AbstractType $type
) {
/**
* Checks if parameter typehinting is AbstractType
* In this case, form type as defined me... | [
"private",
"function",
"getBuiltObject",
"(",
"Request",
"$",
"request",
",",
"FormFactoryInterface",
"$",
"formFactory",
",",
"CreateForm",
"$",
"annotation",
",",
"string",
"$",
"parameterClass",
",",
"AbstractType",
"$",
"type",
")",
"{",
"/**\n * Checks ... | Built and return desired object.
@param Request $request
@param FormFactoryInterface $formFactory
@param CreateForm $annotation
@param string $parameterClass
@param AbstractType $type
@return mixed | [
"Built",
"and",
"return",
"desired",
"object",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/FormAnnotationResolver.php#L141-L197 |
28,429 | QoboLtd/cakephp-search | src/Model/Table/WidgetsTable.php | WidgetsTable.getWidgets | public function getWidgets(): array
{
// get widgets through Event broadcast
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_WIDGETS(), $this);
$this->getEventManager()->dispatch($event);
if (empty($event->getResult())) {
return [];
}
// assem... | php | public function getWidgets(): array
{
// get widgets through Event broadcast
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_WIDGETS(), $this);
$this->getEventManager()->dispatch($event);
if (empty($event->getResult())) {
return [];
}
// assem... | [
"public",
"function",
"getWidgets",
"(",
")",
":",
"array",
"{",
"// get widgets through Event broadcast",
"$",
"event",
"=",
"new",
"Event",
"(",
"(",
"string",
")",
"EventName",
"::",
"MODEL_DASHBOARDS_GET_WIDGETS",
"(",
")",
",",
"$",
"this",
")",
";",
"$",... | getWidgets method.
@return mixed[] $result containing all widgets | [
"getWidgets",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Table/WidgetsTable.php#L123-L154 |
28,430 | QoboLtd/cakephp-search | src/Model/Table/WidgetsTable.php | WidgetsTable.saveDashboardWidgets | public function saveDashboardWidgets(string $dashboardId, array $widgets = []): bool
{
$result = false;
if (empty($widgets)) {
return $result;
}
foreach ($widgets as $item) {
$widget = [
'dashboard_id' => $dashboardId,
'widget... | php | public function saveDashboardWidgets(string $dashboardId, array $widgets = []): bool
{
$result = false;
if (empty($widgets)) {
return $result;
}
foreach ($widgets as $item) {
$widget = [
'dashboard_id' => $dashboardId,
'widget... | [
"public",
"function",
"saveDashboardWidgets",
"(",
"string",
"$",
"dashboardId",
",",
"array",
"$",
"widgets",
"=",
"[",
"]",
")",
":",
"bool",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"empty",
"(",
"$",
"widgets",
")",
")",
"{",
"return",
"... | Save Dashboard Widgets
@param string $dashboardId of the instance
@param mixed[] $widgets of the dashboard
@return bool $result of the save operation. | [
"Save",
"Dashboard",
"Widgets"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Table/WidgetsTable.php#L200-L227 |
28,431 | rinvex/cortex-pages | src/Http/Controllers/Adminarea/PagesMediaController.php | PagesMediaController.index | public function index(Page $page, MediaDataTable $mediaDataTable)
{
return $mediaDataTable->with([
'resource' => $page,
'tabs' => 'adminarea.pages.tabs',
'id' => "adminarea-pages-{$page->getRouteKey()}-media-table",
'url' => route('adminarea.pages.media.store'... | php | public function index(Page $page, MediaDataTable $mediaDataTable)
{
return $mediaDataTable->with([
'resource' => $page,
'tabs' => 'adminarea.pages.tabs',
'id' => "adminarea-pages-{$page->getRouteKey()}-media-table",
'url' => route('adminarea.pages.media.store'... | [
"public",
"function",
"index",
"(",
"Page",
"$",
"page",
",",
"MediaDataTable",
"$",
"mediaDataTable",
")",
"{",
"return",
"$",
"mediaDataTable",
"->",
"with",
"(",
"[",
"'resource'",
"=>",
"$",
"page",
",",
"'tabs'",
"=>",
"'adminarea.pages.tabs'",
",",
"'i... | List all page media.
@param \Cortex\Foundation\DataTables\MediaDataTable $mediaDataTable
@param \Cortex\Pages\Models\Page $page
@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse | [
"List",
"all",
"page",
"media",
"."
] | 7229fedb34d352fda0e721f950c55074f0fb0dce | https://github.com/rinvex/cortex-pages/blob/7229fedb34d352fda0e721f950c55074f0fb0dce/src/Http/Controllers/Adminarea/PagesMediaController.php#L48-L56 |
28,432 | rinvex/cortex-pages | src/Http/Controllers/Adminarea/PagesMediaController.php | PagesMediaController.store | public function store(ImageFormRequest $request, Page $page): void
{
$page->addMediaFromRequest('file')
->sanitizingFileName(function ($fileName) {
return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
})
->toMediaCollection('default', con... | php | public function store(ImageFormRequest $request, Page $page): void
{
$page->addMediaFromRequest('file')
->sanitizingFileName(function ($fileName) {
return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
})
->toMediaCollection('default', con... | [
"public",
"function",
"store",
"(",
"ImageFormRequest",
"$",
"request",
",",
"Page",
"$",
"page",
")",
":",
"void",
"{",
"$",
"page",
"->",
"addMediaFromRequest",
"(",
"'file'",
")",
"->",
"sanitizingFileName",
"(",
"function",
"(",
"$",
"fileName",
")",
"... | Store new page media.
@param \Cortex\Foundation\Http\Requests\ImageFormRequest $request
@param \Cortex\Pages\Models\Page $page
@return void | [
"Store",
"new",
"page",
"media",
"."
] | 7229fedb34d352fda0e721f950c55074f0fb0dce | https://github.com/rinvex/cortex-pages/blob/7229fedb34d352fda0e721f950c55074f0fb0dce/src/Http/Controllers/Adminarea/PagesMediaController.php#L66-L73 |
28,433 | rinvex/cortex-pages | src/Http/Controllers/Adminarea/PagesMediaController.php | PagesMediaController.destroy | public function destroy(Page $page, Media $media)
{
$page->media()->where($media->getKeyName(), $media->getKey())->first()->delete();
return intend([
'url' => route('adminarea.pages.media.index', ['page' => $page]),
'with' => ['warning' => trans('cortex/foundation::messages.... | php | public function destroy(Page $page, Media $media)
{
$page->media()->where($media->getKeyName(), $media->getKey())->first()->delete();
return intend([
'url' => route('adminarea.pages.media.index', ['page' => $page]),
'with' => ['warning' => trans('cortex/foundation::messages.... | [
"public",
"function",
"destroy",
"(",
"Page",
"$",
"page",
",",
"Media",
"$",
"media",
")",
"{",
"$",
"page",
"->",
"media",
"(",
")",
"->",
"where",
"(",
"$",
"media",
"->",
"getKeyName",
"(",
")",
",",
"$",
"media",
"->",
"getKey",
"(",
")",
")... | Destroy given page media.
@param \Cortex\Pages\Models\Page $page
@param \Spatie\MediaLibrary\Models\Media $media
@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse | [
"Destroy",
"given",
"page",
"media",
"."
] | 7229fedb34d352fda0e721f950c55074f0fb0dce | https://github.com/rinvex/cortex-pages/blob/7229fedb34d352fda0e721f950c55074f0fb0dce/src/Http/Controllers/Adminarea/PagesMediaController.php#L83-L91 |
28,434 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.execute | public function execute(array $data) : QueryInterface
{
$data = Validator::validateData($this->table, $data, $this->user);
// initialize query
$query = $this->table->find('all');
$where = $this->getWhereClause($data);
$group = $this->getGroupByClause($data);
$select... | php | public function execute(array $data) : QueryInterface
{
$data = Validator::validateData($this->table, $data, $this->user);
// initialize query
$query = $this->table->find('all');
$where = $this->getWhereClause($data);
$group = $this->getGroupByClause($data);
$select... | [
"public",
"function",
"execute",
"(",
"array",
"$",
"data",
")",
":",
"QueryInterface",
"{",
"$",
"data",
"=",
"Validator",
"::",
"validateData",
"(",
"$",
"this",
"->",
"table",
",",
"$",
"data",
",",
"$",
"this",
"->",
"user",
")",
";",
"// initializ... | Search method.
@param mixed[] $data Request data
@return \Cake\Datasource\QueryInterface | [
"Search",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L97-L133 |
28,435 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.create | public function create(array $searchData): string
{
$searchData = Validator::validateData($this->table, $searchData, $this->user);
// pre-save search
return $this->preSave($searchData);
} | php | public function create(array $searchData): string
{
$searchData = Validator::validateData($this->table, $searchData, $this->user);
// pre-save search
return $this->preSave($searchData);
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"searchData",
")",
":",
"string",
"{",
"$",
"searchData",
"=",
"Validator",
"::",
"validateData",
"(",
"$",
"this",
"->",
"table",
",",
"$",
"searchData",
",",
"$",
"this",
"->",
"user",
")",
";",
"// ... | Create search.
@param mixed[] $searchData Request data
@return string | [
"Create",
"search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L141-L147 |
28,436 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.update | public function update(array $searchData, string $id)
{
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->get($id);
$entity = $this->normalize($entity, $entity->get('content'), $searchData);
return $this->searchTable->save($entity);
} | php | public function update(array $searchData, string $id)
{
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->get($id);
$entity = $this->normalize($entity, $entity->get('content'), $searchData);
return $this->searchTable->save($entity);
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"searchData",
",",
"string",
"$",
"id",
")",
"{",
"/**\n * @var \\Search\\Model\\Entity\\SavedSearch\n */",
"$",
"entity",
"=",
"$",
"this",
"->",
"searchTable",
"->",
"get",
"(",
"$",
"id",
")",
... | Update search.
@param mixed[] $searchData Request data
@param string $id Existing search id
@return \Cake\Datasource\EntityInterface|false | [
"Update",
"search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L156-L165 |
28,437 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.get | public function get(string $id): SavedSearch
{
$id = !empty($id) ? $id : $this->create([]);
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->get($id);
$entity = $this->normalize($entity, $entity->get('content'), $entity->get('content'));
... | php | public function get(string $id): SavedSearch
{
$id = !empty($id) ? $id : $this->create([]);
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->get($id);
$entity = $this->normalize($entity, $entity->get('content'), $entity->get('content'));
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"id",
")",
":",
"SavedSearch",
"{",
"$",
"id",
"=",
"!",
"empty",
"(",
"$",
"id",
")",
"?",
"$",
"id",
":",
"$",
"this",
"->",
"create",
"(",
"[",
"]",
")",
";",
"/**\n * @var \\Search\\Model\\... | Get search.
@param string $id Existing search id
@return \Search\Model\Entity\SavedSearch | [
"Get",
"search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L173-L183 |
28,438 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.reset | public function reset(SavedSearch $entity) : ?SavedSearch
{
$content = $entity->get('content');
// for backward compatibility
$saved = isset($content['saved']) ? $content['saved'] : $content;
$entity = $this->normalize($entity, $saved, $saved);
return $this->searchTable->sa... | php | public function reset(SavedSearch $entity) : ?SavedSearch
{
$content = $entity->get('content');
// for backward compatibility
$saved = isset($content['saved']) ? $content['saved'] : $content;
$entity = $this->normalize($entity, $saved, $saved);
return $this->searchTable->sa... | [
"public",
"function",
"reset",
"(",
"SavedSearch",
"$",
"entity",
")",
":",
"?",
"SavedSearch",
"{",
"$",
"content",
"=",
"$",
"entity",
"->",
"get",
"(",
"'content'",
")",
";",
"// for backward compatibility",
"$",
"saved",
"=",
"isset",
"(",
"$",
"conten... | Reset search.
@param \Search\Model\Entity\SavedSearch $entity Search entity
@return \Search\Model\Entity\SavedSearch|null | [
"Reset",
"search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L191-L200 |
28,439 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.prepareData | public function prepareData(ServerRequest $request): array
{
$result = $request->getData();
$event = new Event((string)EventName::MODEL_SEARCH_CHILD_ITEMS(), $this, [
'criteria' => $result
]);
EventManager::instance()->dispatch($event);
$result = $event->result ... | php | public function prepareData(ServerRequest $request): array
{
$result = $request->getData();
$event = new Event((string)EventName::MODEL_SEARCH_CHILD_ITEMS(), $this, [
'criteria' => $result
]);
EventManager::instance()->dispatch($event);
$result = $event->result ... | [
"public",
"function",
"prepareData",
"(",
"ServerRequest",
"$",
"request",
")",
":",
"array",
"{",
"$",
"result",
"=",
"$",
"request",
"->",
"getData",
"(",
")",
";",
"$",
"event",
"=",
"new",
"Event",
"(",
"(",
"string",
")",
"EventName",
"::",
"MODEL... | Prepare search data from request data.
@param \Cake\Http\ServerRequest $request Request object
@return mixed[] | [
"Prepare",
"search",
"data",
"from",
"request",
"data",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L208-L232 |
28,440 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.byAssociations | protected function byAssociations(array $data): array
{
$result = [];
foreach ($this->getAssociationsBySearchData($data) as $association) {
// skip non-supported associations
if (!in_array($association->type(), Options::getSearchableAssociations())) {
continue... | php | protected function byAssociations(array $data): array
{
$result = [];
foreach ($this->getAssociationsBySearchData($data) as $association) {
// skip non-supported associations
if (!in_array($association->type(), Options::getSearchableAssociations())) {
continue... | [
"protected",
"function",
"byAssociations",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAssociationsBySearchData",
"(",
"$",
"data",
")",
"as",
"$",
"association",
")",
"{",
... | Search by current Table associations.
@param mixed[] $data Search data
@return mixed[] | [
"Search",
"by",
"current",
"Table",
"associations",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L240-L276 |
28,441 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.getAssociationsBySearchData | private function getAssociationsBySearchData(array $data) : array
{
$fields = [];
if (array_key_exists('criteria', $data)) {
foreach (array_keys($data['criteria']) as $field) {
$field = $this->table->aliasField((string)$field);
if (! in_array($field, $fiel... | php | private function getAssociationsBySearchData(array $data) : array
{
$fields = [];
if (array_key_exists('criteria', $data)) {
foreach (array_keys($data['criteria']) as $field) {
$field = $this->table->aliasField((string)$field);
if (! in_array($field, $fiel... | [
"private",
"function",
"getAssociationsBySearchData",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"if",
"(",
"array_key_exists",
"(",
"'criteria'",
",",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"array_keys",
"... | Retrieves search-required associations based on the provided search data.
@param mixed[] $data Search data
@return mixed[] | [
"Retrieves",
"search",
"-",
"required",
"associations",
"based",
"on",
"the",
"provided",
"search",
"data",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L284-L326 |
28,442 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.getWhereClause | protected function getWhereClause(array $data): array
{
$result = [];
if (empty($data['criteria'])) {
return $result;
}
// get current module searchable fields.
$moduleFields = $this->filterFields(array_keys($this->searchFields));
foreach ($data['criter... | php | protected function getWhereClause(array $data): array
{
$result = [];
if (empty($data['criteria'])) {
return $result;
}
// get current module searchable fields.
$moduleFields = $this->filterFields(array_keys($this->searchFields));
foreach ($data['criter... | [
"protected",
"function",
"getWhereClause",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'criteria'",
"]",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"// get... | Prepare search query's where statement
@param mixed[] $data request data
@return mixed[] | [
"Prepare",
"search",
"query",
"s",
"where",
"statement"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L334-L366 |
28,443 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.filterFields | protected function filterFields(array $fields): array
{
if (empty($fields)) {
return [];
}
foreach ($fields as $k => $v) {
if (false !== strpos($v, $this->table->getAlias() . '.')) {
continue;
}
unset($fields[$k]);
}
... | php | protected function filterFields(array $fields): array
{
if (empty($fields)) {
return [];
}
foreach ($fields as $k => $v) {
if (false !== strpos($v, $this->table->getAlias() . '.')) {
continue;
}
unset($fields[$k]);
}
... | [
"protected",
"function",
"filterFields",
"(",
"array",
"$",
"fields",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"k",
"=>",
"$",
"v",
")",... | Filter only current module fields.
@param mixed[] $fields Search fields
@return mixed[] | [
"Filter",
"only",
"current",
"module",
"fields",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L374-L389 |
28,444 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.getWhereCondition | protected function getWhereCondition(string $field, array $criteria): array
{
$value = is_array($criteria['value']) ? $criteria['value'] : trim($criteria['value']);
if ('' === $value) {
return $this->getEmptyWhereCondition($field, $criteria);
}
$value = $this->handleMag... | php | protected function getWhereCondition(string $field, array $criteria): array
{
$value = is_array($criteria['value']) ? $criteria['value'] : trim($criteria['value']);
if ('' === $value) {
return $this->getEmptyWhereCondition($field, $criteria);
}
$value = $this->handleMag... | [
"protected",
"function",
"getWhereCondition",
"(",
"string",
"$",
"field",
",",
"array",
"$",
"criteria",
")",
":",
"array",
"{",
"$",
"value",
"=",
"is_array",
"(",
"$",
"criteria",
"[",
"'value'",
"]",
")",
"?",
"$",
"criteria",
"[",
"'value'",
"]",
... | Prepare and return where statement condition.
@param string $field Field name
@param mixed[] $criteria Criteria properties
@return mixed[] | [
"Prepare",
"and",
"return",
"where",
"statement",
"condition",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L398-L431 |
28,445 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.handleMagicValue | protected function handleMagicValue($value)
{
switch (gettype($value)) {
case 'string':
$value = (new MagicValue($value, $this->user))->get();
break;
case 'array':
foreach ($value as $key => $val) {
$value[$key] = (... | php | protected function handleMagicValue($value)
{
switch (gettype($value)) {
case 'string':
$value = (new MagicValue($value, $this->user))->get();
break;
case 'array':
foreach ($value as $key => $val) {
$value[$key] = (... | [
"protected",
"function",
"handleMagicValue",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"gettype",
"(",
"$",
"value",
")",
")",
"{",
"case",
"'string'",
":",
"$",
"value",
"=",
"(",
"new",
"MagicValue",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"us... | Magic value handler.
@param mixed $value Field value
@return mixed | [
"Magic",
"value",
"handler",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L439-L454 |
28,446 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.getEmptyWhereCondition | protected function getEmptyWhereCondition(string $field, array $criteria): array
{
$emptyCriteria = $this->searchFields[$field]['operators'][$criteria['operator']]['emptyCriteria'];
$result = [];
foreach ($emptyCriteria['values'] as $value) {
$result[$emptyCriteria['aggregator']... | php | protected function getEmptyWhereCondition(string $field, array $criteria): array
{
$emptyCriteria = $this->searchFields[$field]['operators'][$criteria['operator']]['emptyCriteria'];
$result = [];
foreach ($emptyCriteria['values'] as $value) {
$result[$emptyCriteria['aggregator']... | [
"protected",
"function",
"getEmptyWhereCondition",
"(",
"string",
"$",
"field",
",",
"array",
"$",
"criteria",
")",
":",
"array",
"{",
"$",
"emptyCriteria",
"=",
"$",
"this",
"->",
"searchFields",
"[",
"$",
"field",
"]",
"[",
"'operators'",
"]",
"[",
"$",
... | Prepare and return where statement condition for empty value.
@param string $field Field name
@param mixed[] $criteria Criteria properties
@return mixed[] | [
"Prepare",
"and",
"return",
"where",
"statement",
"condition",
"for",
"empty",
"value",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L463-L473 |
28,447 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.getSelectClause | public function getSelectClause(array $data): array
{
if (empty($data['display_columns'])) {
return [];
}
$result = (array)$data['display_columns'];
foreach ((array)$this->table->getPrimaryKey() as $primaryKey) {
$primaryKey = $this->table->aliasField($primar... | php | public function getSelectClause(array $data): array
{
if (empty($data['display_columns'])) {
return [];
}
$result = (array)$data['display_columns'];
foreach ((array)$this->table->getPrimaryKey() as $primaryKey) {
$primaryKey = $this->table->aliasField($primar... | [
"public",
"function",
"getSelectClause",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'display_columns'",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"result",
"=",
"(",
"array",
")",
"$"... | Get fields for Query's select statement.
@param mixed[] $data request data
@return string[] | [
"Get",
"fields",
"for",
"Query",
"s",
"select",
"statement",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L481-L498 |
28,448 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.preSave | protected function preSave(array $data): string
{
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->newEntity();
$entity = $this->normalize($entity, $data, $data);
$this->searchTable->save($entity);
return $entity->id;
} | php | protected function preSave(array $data): string
{
/**
* @var \Search\Model\Entity\SavedSearch
*/
$entity = $this->searchTable->newEntity();
$entity = $this->normalize($entity, $data, $data);
$this->searchTable->save($entity);
return $entity->id;
} | [
"protected",
"function",
"preSave",
"(",
"array",
"$",
"data",
")",
":",
"string",
"{",
"/**\n * @var \\Search\\Model\\Entity\\SavedSearch\n */",
"$",
"entity",
"=",
"$",
"this",
"->",
"searchTable",
"->",
"newEntity",
"(",
")",
";",
"$",
"entity",
... | Method that pre-saves search and returns saved record id.
@param mixed[] $data Search data
@return string | [
"Method",
"that",
"pre",
"-",
"saves",
"search",
"and",
"returns",
"saved",
"record",
"id",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L517-L528 |
28,449 | QoboLtd/cakephp-search | src/Utility/Search.php | Search.normalize | protected function normalize(SavedSearch $entity, array $saved, array $latest) : SavedSearch
{
// Backward compatibility: search content must always contain 'saved' and 'latest' keys.
$saved = isset($saved['saved']) ? $saved['saved'] : $saved;
$latest = isset($latest['latest']) ?
... | php | protected function normalize(SavedSearch $entity, array $saved, array $latest) : SavedSearch
{
// Backward compatibility: search content must always contain 'saved' and 'latest' keys.
$saved = isset($saved['saved']) ? $saved['saved'] : $saved;
$latest = isset($latest['latest']) ?
... | [
"protected",
"function",
"normalize",
"(",
"SavedSearch",
"$",
"entity",
",",
"array",
"$",
"saved",
",",
"array",
"$",
"latest",
")",
":",
"SavedSearch",
"{",
"// Backward compatibility: search content must always contain 'saved' and 'latest' keys.",
"$",
"saved",
"=",
... | Normalize search.
@param \Search\Model\Entity\SavedSearch $entity Search entity
@param mixed[] $saved Saved search data
@param mixed[] $latest Latest search data
@return \Search\Model\Entity\SavedSearch | [
"Normalize",
"search",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Search.php#L538-L577 |
28,450 | TYPO3-CMS/redirects | Classes/Hooks/DataHandlerCacheFlushingHook.php | DataHandlerCacheFlushingHook.rebuildRedirectCacheIfNecessary | public function rebuildRedirectCacheIfNecessary(array $parameters, DataHandler $dataHandler)
{
if (isset($dataHandler->datamap['sys_redirect']) || isset($dataHandler->cmdmap['sys_redirect'])) {
GeneralUtility::makeInstance(RedirectCacheService::class)->rebuild();
}
} | php | public function rebuildRedirectCacheIfNecessary(array $parameters, DataHandler $dataHandler)
{
if (isset($dataHandler->datamap['sys_redirect']) || isset($dataHandler->cmdmap['sys_redirect'])) {
GeneralUtility::makeInstance(RedirectCacheService::class)->rebuild();
}
} | [
"public",
"function",
"rebuildRedirectCacheIfNecessary",
"(",
"array",
"$",
"parameters",
",",
"DataHandler",
"$",
"dataHandler",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"dataHandler",
"->",
"datamap",
"[",
"'sys_redirect'",
"]",
")",
"||",
"isset",
"(",
"$",
... | Check if the data handler processed a sys_redirect record, if so, rebuild the redirect index cache
@param array $parameters unused
@param DataHandler $dataHandler the data handler object | [
"Check",
"if",
"the",
"data",
"handler",
"processed",
"a",
"sys_redirect",
"record",
"if",
"so",
"rebuild",
"the",
"redirect",
"index",
"cache"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Hooks/DataHandlerCacheFlushingHook.php#L34-L39 |
28,451 | mitchdav/st-george-ipg | src/Request.php | Request.createFromClient | public static function createFromClient(Client $client, $includeTerminalType = TRUE)
{
$request = new Request();
$request->setInterface($client->getInterface());
if ($includeTerminalType) {
$request->setTerminalType($client->getTerminalType());
}
return $request;
} | php | public static function createFromClient(Client $client, $includeTerminalType = TRUE)
{
$request = new Request();
$request->setInterface($client->getInterface());
if ($includeTerminalType) {
$request->setTerminalType($client->getTerminalType());
}
return $request;
} | [
"public",
"static",
"function",
"createFromClient",
"(",
"Client",
"$",
"client",
",",
"$",
"includeTerminalType",
"=",
"TRUE",
")",
"{",
"$",
"request",
"=",
"new",
"Request",
"(",
")",
";",
"$",
"request",
"->",
"setInterface",
"(",
"$",
"client",
"->",
... | Creates the request using information from the client.
@param \StGeorgeIPG\Client $client
@param boolean $includeTerminalType
@return \StGeorgeIPG\Request | [
"Creates",
"the",
"request",
"using",
"information",
"from",
"the",
"client",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Request.php#L195-L206 |
28,452 | mitchdav/st-george-ipg | src/Request.php | Request.validate | public function validate()
{
$this->validateAttributes([
Request::ATTRIBUTE_INTERFACE,
Request::ATTRIBUTE_TRANSACTION_TYPE,
]);
$transactionType = $this->getTransactionType();
switch ($transactionType) {
case Request::TRANSACTION_TYPE_PURCHASE:
case Request::TRANSACTION_TYPE_PRE_AUTH: {
$this... | php | public function validate()
{
$this->validateAttributes([
Request::ATTRIBUTE_INTERFACE,
Request::ATTRIBUTE_TRANSACTION_TYPE,
]);
$transactionType = $this->getTransactionType();
switch ($transactionType) {
case Request::TRANSACTION_TYPE_PURCHASE:
case Request::TRANSACTION_TYPE_PRE_AUTH: {
$this... | [
"public",
"function",
"validate",
"(",
")",
"{",
"$",
"this",
"->",
"validateAttributes",
"(",
"[",
"Request",
"::",
"ATTRIBUTE_INTERFACE",
",",
"Request",
"::",
"ATTRIBUTE_TRANSACTION_TYPE",
",",
"]",
")",
";",
"$",
"transactionType",
"=",
"$",
"this",
"->",
... | Validates the request attributes based on the transaction type, and the rules specified by St.George.
@return boolean
@throws \StGeorgeIPG\Exceptions\InvalidAttributeValueException | [
"Validates",
"the",
"request",
"attributes",
"based",
"on",
"the",
"transaction",
"type",
"and",
"the",
"rules",
"specified",
"by",
"St",
".",
"George",
"."
] | 2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc | https://github.com/mitchdav/st-george-ipg/blob/2ed1a458d9bb24b3e8c554c20ba4ea75ed6548bc/src/Request.php#L502-L596 |
28,453 | TYPO3-CMS/redirects | Classes/Repository/RedirectRepository.php | RedirectRepository.findRedirectsByDemand | public function findRedirectsByDemand(): array
{
return $this->getQueryBuilderForDemand()
->setMaxResults($this->demand->getLimit())
->setFirstResult($this->demand->getOffset())
->execute()
->fetchAll();
} | php | public function findRedirectsByDemand(): array
{
return $this->getQueryBuilderForDemand()
->setMaxResults($this->demand->getLimit())
->setFirstResult($this->demand->getOffset())
->execute()
->fetchAll();
} | [
"public",
"function",
"findRedirectsByDemand",
"(",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"getQueryBuilderForDemand",
"(",
")",
"->",
"setMaxResults",
"(",
"$",
"this",
"->",
"demand",
"->",
"getLimit",
"(",
")",
")",
"->",
"setFirstResult",
"... | Used within the backend module, which also includes the hidden records, but never deleted records.
@return array | [
"Used",
"within",
"the",
"backend",
"module",
"which",
"also",
"includes",
"the",
"hidden",
"records",
"but",
"never",
"deleted",
"records",
"."
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Repository/RedirectRepository.php#L49-L56 |
28,454 | TYPO3-CMS/redirects | Classes/Repository/RedirectRepository.php | RedirectRepository.getQueryBuilderForDemand | protected function getQueryBuilderForDemand(): QueryBuilder
{
$queryBuilder = $this->getQueryBuilder();
$queryBuilder
->select('*')
->from('sys_redirect')
->orderBy('source_host')
->addOrderBy('source_path');
$constraints = [];
if ($th... | php | protected function getQueryBuilderForDemand(): QueryBuilder
{
$queryBuilder = $this->getQueryBuilder();
$queryBuilder
->select('*')
->from('sys_redirect')
->orderBy('source_host')
->addOrderBy('source_path');
$constraints = [];
if ($th... | [
"protected",
"function",
"getQueryBuilderForDemand",
"(",
")",
":",
"QueryBuilder",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
";",
"$",
"queryBuilder",
"->",
"select",
"(",
"'*'",
")",
"->",
"from",
"(",
"'sys_redirect'",
... | Prepares the QueryBuilder with Constraints from the Demand
@return QueryBuilder | [
"Prepares",
"the",
"QueryBuilder",
"with",
"Constraints",
"from",
"the",
"Demand"
] | c617ec21dac92873bf9890fa0bfc1576afc86b5a | https://github.com/TYPO3-CMS/redirects/blob/c617ec21dac92873bf9890fa0bfc1576afc86b5a/Classes/Repository/RedirectRepository.php#L71-L115 |
28,455 | gocom/rah_sitemap | src/Rah/Sitemap.php | Rah_Sitemap.cleanUrlHandler | public function cleanUrlHandler(): void
{
global $pretext;
$basename = explode('?', (string) $pretext['request_uri']);
$basename = basename(array_shift($basename));
if ($basename === 'robots.txt') {
$this->sendRobots();
}
if ($basename === 'sitemap.xml'... | php | public function cleanUrlHandler(): void
{
global $pretext;
$basename = explode('?', (string) $pretext['request_uri']);
$basename = basename(array_shift($basename));
if ($basename === 'robots.txt') {
$this->sendRobots();
}
if ($basename === 'sitemap.xml'... | [
"public",
"function",
"cleanUrlHandler",
"(",
")",
":",
"void",
"{",
"global",
"$",
"pretext",
";",
"$",
"basename",
"=",
"explode",
"(",
"'?'",
",",
"(",
"string",
")",
"$",
"pretext",
"[",
"'request_uri'",
"]",
")",
";",
"$",
"basename",
"=",
"basena... | Handles routing clean URLs. | [
"Handles",
"routing",
"clean",
"URLs",
"."
] | a01e380b6695ad283fbdf402fb2ea1a640c607f9 | https://github.com/gocom/rah_sitemap/blob/a01e380b6695ad283fbdf402fb2ea1a640c607f9/src/Rah/Sitemap.php#L122-L136 |
28,456 | gocom/rah_sitemap | src/Rah/Sitemap.php | Rah_Sitemap.addUrl | private function addUrl($url, $lastmod = null): self
{
if (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) {
$url = hu.ltrim($url, '/');
}
if (preg_match('/[\'"<>]/', $url)) {
$url = htmlspecialchars($url, ENT_QUOTES);
}
if (isset($t... | php | private function addUrl($url, $lastmod = null): self
{
if (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) {
$url = hu.ltrim($url, '/');
}
if (preg_match('/[\'"<>]/', $url)) {
$url = htmlspecialchars($url, ENT_QUOTES);
}
if (isset($t... | [
"private",
"function",
"addUrl",
"(",
"$",
"url",
",",
"$",
"lastmod",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"strpos",
"(",
"$",
"url",
",",
"'http://'",
")",
"!==",
"0",
"&&",
"strpos",
"(",
"$",
"url",
",",
"'https://'",
")",
"!==",
"0... | Renders a <url> element to the XML document.
@param string $url The URL
@param int|string $lastmod The modification date
@return $this | [
"Renders",
"a",
"<",
";",
"url>",
";",
"element",
"to",
"the",
"XML",
"document",
"."
] | a01e380b6695ad283fbdf402fb2ea1a640c607f9 | https://github.com/gocom/rah_sitemap/blob/a01e380b6695ad283fbdf402fb2ea1a640c607f9/src/Rah/Sitemap.php#L268-L299 |
28,457 | gocom/rah_sitemap | src/Rah/Sitemap.php | Rah_Sitemap.populateArticleFields | private function populateArticleFields(): self
{
$columns = (array) @getThings('describe '.safe_pfx('textpattern'));
foreach ($columns as $name) {
$this->articleFields[strtolower($name)] = $name;
}
foreach (getCustomFields() as $id => $name) {
$this->article... | php | private function populateArticleFields(): self
{
$columns = (array) @getThings('describe '.safe_pfx('textpattern'));
foreach ($columns as $name) {
$this->articleFields[strtolower($name)] = $name;
}
foreach (getCustomFields() as $id => $name) {
$this->article... | [
"private",
"function",
"populateArticleFields",
"(",
")",
":",
"self",
"{",
"$",
"columns",
"=",
"(",
"array",
")",
"@",
"getThings",
"(",
"'describe '",
".",
"safe_pfx",
"(",
"'textpattern'",
")",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"na... | Picks up names of article fields.
@return $this | [
"Picks",
"up",
"names",
"of",
"article",
"fields",
"."
] | a01e380b6695ad283fbdf402fb2ea1a640c607f9 | https://github.com/gocom/rah_sitemap/blob/a01e380b6695ad283fbdf402fb2ea1a640c607f9/src/Rah/Sitemap.php#L306-L319 |
28,458 | gocom/rah_sitemap | src/Rah/Sitemap.php | Rah_Sitemap.prefs | public function prefs(): void
{
pagetop(gTxt('rah_sitemap'));
echo graf(
href(gTxt('rah_sitemap_view_prefs'), ['event' => 'prefs']) . br .
href(gTxt('rah_sitemap_view_sitemap'), hu . '?rah_sitemap=sitemap')
);
} | php | public function prefs(): void
{
pagetop(gTxt('rah_sitemap'));
echo graf(
href(gTxt('rah_sitemap_view_prefs'), ['event' => 'prefs']) . br .
href(gTxt('rah_sitemap_view_sitemap'), hu . '?rah_sitemap=sitemap')
);
} | [
"public",
"function",
"prefs",
"(",
")",
":",
"void",
"{",
"pagetop",
"(",
"gTxt",
"(",
"'rah_sitemap'",
")",
")",
";",
"echo",
"graf",
"(",
"href",
"(",
"gTxt",
"(",
"'rah_sitemap_view_prefs'",
")",
",",
"[",
"'event'",
"=>",
"'prefs'",
"]",
")",
".",... | Options panel. | [
"Options",
"panel",
"."
] | a01e380b6695ad283fbdf402fb2ea1a640c607f9 | https://github.com/gocom/rah_sitemap/blob/a01e380b6695ad283fbdf402fb2ea1a640c607f9/src/Rah/Sitemap.php#L324-L332 |
28,459 | gocom/rah_sitemap | src/Rah/Sitemap.php | Rah_Sitemap.renderSectionOptions | public function renderSectionOptions($event, $step, $void, $r): string
{
if ($r['name'] !== 'default') {
return inputLabel(
'rah_sitemap_include_in',
yesnoradio('rah_sitemap_include_in', !empty($r['rah_sitemap_include_in']), '', ''),
'',
... | php | public function renderSectionOptions($event, $step, $void, $r): string
{
if ($r['name'] !== 'default') {
return inputLabel(
'rah_sitemap_include_in',
yesnoradio('rah_sitemap_include_in', !empty($r['rah_sitemap_include_in']), '', ''),
'',
... | [
"public",
"function",
"renderSectionOptions",
"(",
"$",
"event",
",",
"$",
"step",
",",
"$",
"void",
",",
"$",
"r",
")",
":",
"string",
"{",
"if",
"(",
"$",
"r",
"[",
"'name'",
"]",
"!==",
"'default'",
")",
"{",
"return",
"inputLabel",
"(",
"'rah_sit... | Shows settings at the Sections panel.
@param string $event The event
@param string $step The step
@param bool $void Not used
@param array $r The section data as an array
@return string HTML | [
"Shows",
"settings",
"at",
"the",
"Sections",
"panel",
"."
] | a01e380b6695ad283fbdf402fb2ea1a640c607f9 | https://github.com/gocom/rah_sitemap/blob/a01e380b6695ad283fbdf402fb2ea1a640c607f9/src/Rah/Sitemap.php#L343-L353 |
28,460 | QoboLtd/cakephp-search | src/Controller/SearchTrait.php | SearchTrait.getAjaxViewVars | protected function getAjaxViewVars(array $searchData, RepositoryInterface $table, Search $search): array
{
/** @var \Cake\ORM\Table */
$table = $table;
$searchData['sort_by_field'] = Hash::get($this->request->getQueryParams(), 'sort', '');
$searchData['sort_by_order'] = Hash::get(
... | php | protected function getAjaxViewVars(array $searchData, RepositoryInterface $table, Search $search): array
{
/** @var \Cake\ORM\Table */
$table = $table;
$searchData['sort_by_field'] = Hash::get($this->request->getQueryParams(), 'sort', '');
$searchData['sort_by_order'] = Hash::get(
... | [
"protected",
"function",
"getAjaxViewVars",
"(",
"array",
"$",
"searchData",
",",
"RepositoryInterface",
"$",
"table",
",",
"Search",
"$",
"search",
")",
":",
"array",
"{",
"/** @var \\Cake\\ORM\\Table */",
"$",
"table",
"=",
"$",
"table",
";",
"$",
"searchData"... | Get AJAX response view variables
@param mixed[] $searchData Search data
@param \Cake\Datasource\RepositoryInterface $table Table instance
@param \Search\Utility\Search $search Search instance
@return mixed[] Variables and values for AJAX response | [
"Get",
"AJAX",
"response",
"view",
"variables"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Controller/SearchTrait.php#L137-L177 |
28,461 | QoboLtd/cakephp-search | src/Controller/SearchTrait.php | SearchTrait.exportSearch | public function exportSearch(string $id, string $filename)
{
$filename = '' === trim($filename) ? $this->name : $filename;
$export = new Export($id, $filename, $this->Auth->user());
if ($this->request->is('ajax') && $this->request->accepts('application/json')) {
$page = (int)Has... | php | public function exportSearch(string $id, string $filename)
{
$filename = '' === trim($filename) ? $this->name : $filename;
$export = new Export($id, $filename, $this->Auth->user());
if ($this->request->is('ajax') && $this->request->accepts('application/json')) {
$page = (int)Has... | [
"public",
"function",
"exportSearch",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"''",
"===",
"trim",
"(",
"$",
"filename",
")",
"?",
"$",
"this",
"->",
"name",
":",
"$",
"filename",
";",
"$",
"export",
... | Export Search results
Method responsible for exporting search results
into a CSV file and forcing file download.
@param string $id Pre-saved search id
@param string $filename Export filename
@return \Cake\Http\Response|void | [
"Export",
"Search",
"results"
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Controller/SearchTrait.php#L288-L313 |
28,462 | BabDev/Transifex-API | src/Connector/Resources.php | Resources.deleteResource | public function deleteResource(string $project, string $resource): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/resource/$resource")));
} | php | public function deleteResource(string $project, string $resource): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/resource/$resource")));
} | [
"public",
"function",
"deleteResource",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"createRequest",
"(",
"'DELETE'",
"... | Delete a resource within a project.
@param string $project The slug for the project the resource is part of
@param string $resource The resource slug within the project
@return ResponseInterface | [
"Delete",
"a",
"resource",
"within",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Resources.php#L84-L87 |
28,463 | BabDev/Transifex-API | src/Connector/Resources.php | Resources.getResource | public function getResource(string $project, string $resource, bool $details = false): ResponseInterface
{
$uri = $this->createUri("/api/2/project/$project/resource/$resource/");
if ($details) {
$uri = $uri->withQuery('details');
}
return $this->client->sendRequest($thi... | php | public function getResource(string $project, string $resource, bool $details = false): ResponseInterface
{
$uri = $this->createUri("/api/2/project/$project/resource/$resource/");
if ($details) {
$uri = $uri->withQuery('details');
}
return $this->client->sendRequest($thi... | [
"public",
"function",
"getResource",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
",",
"bool",
"$",
"details",
"=",
"false",
")",
":",
"ResponseInterface",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"createUri",
"(",
"\"/api/2/project/$projec... | Get information about a resource within a project.
@param string $project The slug for the project the resource is part of
@param string $resource The resource slug within the project
@param bool $details True to retrieve additional project details
@return ResponseInterface | [
"Get",
"information",
"about",
"a",
"resource",
"within",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Resources.php#L98-L107 |
28,464 | BabDev/Transifex-API | src/Connector/Resources.php | Resources.updateResourceContent | public function updateResourceContent(
string $project,
string $resource,
string $content,
string $type = 'string'
): ResponseInterface {
return $this->updateResource($this->createUri("/api/2/project/$project/resource/$resource/content/"), $content, $type);
} | php | public function updateResourceContent(
string $project,
string $resource,
string $content,
string $type = 'string'
): ResponseInterface {
return $this->updateResource($this->createUri("/api/2/project/$project/resource/$resource/content/"), $content, $type);
} | [
"public",
"function",
"updateResourceContent",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
",",
"string",
"$",
"content",
",",
"string",
"$",
"type",
"=",
"'string'",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"update... | Update the content of a resource within a project.
@param string $project The slug for the project the resource is part of
@param string $resource The resource slug within the project
@param string $content The content of the resource, this can either be a string of data or a file path
@param string $type The ty... | [
"Update",
"the",
"content",
"of",
"a",
"resource",
"within",
"a",
"project",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Resources.php#L144-L151 |
28,465 | QoboLtd/cakephp-search | src/Utility/MagicValue.php | MagicValue.get | public function get()
{
$value = str_replace(static::WRAPPER, '', $this->value);
if (! method_exists($this, $value)) {
return $this->value;
}
return $this->{$value}();
} | php | public function get()
{
$value = str_replace(static::WRAPPER, '', $this->value);
if (! method_exists($this, $value)) {
return $this->value;
}
return $this->{$value}();
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"static",
"::",
"WRAPPER",
",",
"''",
",",
"$",
"this",
"->",
"value",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"value",
")",
")",
"{... | Magic value getter.
@return mixed | [
"Magic",
"value",
"getter",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/MagicValue.php#L68-L77 |
28,466 | QoboLtd/cakephp-search | src/Model/Table/DashboardsTable.php | DashboardsTable.getUserDashboards | public function getUserDashboards(array $user): QueryInterface
{
// get all dashboards
$query = $this->find('all')->order('name');
// return all dashboards if current user is superuser
if (isset($user['is_superuser']) && $user['is_superuser']) {
return $query;
}
... | php | public function getUserDashboards(array $user): QueryInterface
{
// get all dashboards
$query = $this->find('all')->order('name');
// return all dashboards if current user is superuser
if (isset($user['is_superuser']) && $user['is_superuser']) {
return $query;
}
... | [
"public",
"function",
"getUserDashboards",
"(",
"array",
"$",
"user",
")",
":",
"QueryInterface",
"{",
"// get all dashboards",
"$",
"query",
"=",
"$",
"this",
"->",
"find",
"(",
"'all'",
")",
"->",
"order",
"(",
"'name'",
")",
";",
"// return all dashboards i... | Get specified user accessible dashboards.
@param mixed[] $user user details
@return \Cake\Datasource\QueryInterface | [
"Get",
"specified",
"user",
"accessible",
"dashboards",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Model/Table/DashboardsTable.php#L95-L133 |
28,467 | mmoreram/ControllerExtraBundle | Resolver/LogAnnotationResolver.php | LogAnnotationResolver.logMessage | private function logMessage(
LoggerInterface $logger,
string $level,
string $value
) {
/**
* Logs content, using specified level.
*/
$logger->$level($value);
} | php | private function logMessage(
LoggerInterface $logger,
string $level,
string $value
) {
/**
* Logs content, using specified level.
*/
$logger->$level($value);
} | [
"private",
"function",
"logMessage",
"(",
"LoggerInterface",
"$",
"logger",
",",
"string",
"$",
"level",
",",
"string",
"$",
"value",
")",
"{",
"/**\n * Logs content, using specified level.\n */",
"$",
"logger",
"->",
"$",
"level",
"(",
"$",
"value",... | Send value to log.
@param LoggerInterface $logger
@param string $level
@param string $value | [
"Send",
"value",
"to",
"log",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/LogAnnotationResolver.php#L166-L175 |
28,468 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Order/Standard.php | Standard.createOrder | protected function createOrder( $baseId )
{
$context = $this->getContext();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'order' );
$item = $cntl->add( $baseId, ['order.type' => 'jsonapi'] )->store();
$context->getSession()->set( 'aimeos/orderid', $item->getId() );
return $item;
} | php | protected function createOrder( $baseId )
{
$context = $this->getContext();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'order' );
$item = $cntl->add( $baseId, ['order.type' => 'jsonapi'] )->store();
$context->getSession()->set( 'aimeos/orderid', $item->getId() );
return $item;
} | [
"protected",
"function",
"createOrder",
"(",
"$",
"baseId",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
";",
"$",
"cntl",
"=",
"\\",
"Aimeos",
"\\",
"Controller",
"\\",
"Frontend",
"::",
"create",
"(",
"$",
"context",
",",... | Adds and returns a new order item for the given order base ID
@param string $baseId Unique order base ID
@return \Aimeos\MShop\Order\Item\Iface New order item | [
"Adds",
"and",
"returns",
"a",
"new",
"order",
"item",
"for",
"the",
"given",
"order",
"base",
"ID"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Order/Standard.php#L175-L184 |
28,469 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Order/Standard.php | Standard.getBasket | protected function getBasket( $basketId )
{
$context = $this->getContext();
$baseId = $context->getSession()->get( 'aimeos/order.baseid' );
if( $baseId != $basketId )
{
$msg = sprintf( 'No basket for the "order.baseid" ("%1$s") found', $basketId );
throw new \Aimeos\Client\JsonApi\Exception( $msg, 403 )... | php | protected function getBasket( $basketId )
{
$context = $this->getContext();
$baseId = $context->getSession()->get( 'aimeos/order.baseid' );
if( $baseId != $basketId )
{
$msg = sprintf( 'No basket for the "order.baseid" ("%1$s") found', $basketId );
throw new \Aimeos\Client\JsonApi\Exception( $msg, 403 )... | [
"protected",
"function",
"getBasket",
"(",
"$",
"basketId",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
";",
"$",
"baseId",
"=",
"$",
"context",
"->",
"getSession",
"(",
")",
"->",
"get",
"(",
"'aimeos/order.baseid'",
")",
... | Returns the basket object for the given ID
@param string $basketId Unique order base ID
@return \Aimeos\MShop\Order\Item\Base\Iface Basket object including only the services
@throws \Aimeos\Client\JsonApi\Exception If basket ID is not the same as stored before in the current session | [
"Returns",
"the",
"basket",
"object",
"for",
"the",
"given",
"ID"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Order/Standard.php#L194-L209 |
28,470 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Order/Standard.php | Standard.render | protected function render( ResponseInterface $response, \Aimeos\MW\View\Iface $view, $status )
{
/** client/jsonapi/order/standard/template
* Relative path to the order JSON API template
*
* The template file contains the code and processing instructions
* to generate the result shown in the JSON API bod... | php | protected function render( ResponseInterface $response, \Aimeos\MW\View\Iface $view, $status )
{
/** client/jsonapi/order/standard/template
* Relative path to the order JSON API template
*
* The template file contains the code and processing instructions
* to generate the result shown in the JSON API bod... | [
"protected",
"function",
"render",
"(",
"ResponseInterface",
"$",
"response",
",",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"View",
"\\",
"Iface",
"$",
"view",
",",
"$",
"status",
")",
"{",
"/** client/jsonapi/order/standard/template\n\t\t * Relative path to the order JSON API... | Returns the response object with the rendered header and body
@param \Psr\Http\Message\ResponseInterface $response Response object
@param \Aimeos\MW\View\Iface $view View instance
@param integer $status HTTP status code
@return \Psr\Http\Message\ResponseInterface Modified response object | [
"Returns",
"the",
"response",
"object",
"with",
"the",
"rendered",
"header",
"and",
"body"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Order/Standard.php#L322-L353 |
28,471 | QoboLtd/cakephp-search | src/Event/Model/WidgetsListener.php | WidgetsListener.getWidgets | public function getWidgets(Event $event): void
{
$result = array_merge(
(array)$event->result,
$this->getSavedSearchWidgets(),
$this->getReportWidgets(),
$this->getAppWidgets()
);
$event->result = array_filter($result);
} | php | public function getWidgets(Event $event): void
{
$result = array_merge(
(array)$event->result,
$this->getSavedSearchWidgets(),
$this->getReportWidgets(),
$this->getAppWidgets()
);
$event->result = array_filter($result);
} | [
"public",
"function",
"getWidgets",
"(",
"Event",
"$",
"event",
")",
":",
"void",
"{",
"$",
"result",
"=",
"array_merge",
"(",
"(",
"array",
")",
"$",
"event",
"->",
"result",
",",
"$",
"this",
"->",
"getSavedSearchWidgets",
"(",
")",
",",
"$",
"this",... | Add widgets for Search plugin's Dashboards.
@param \Cake\Event\Event $event Event instance
@return void | [
"Add",
"widgets",
"for",
"Search",
"plugin",
"s",
"Dashboards",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Event/Model/WidgetsListener.php#L41-L51 |
28,472 | QoboLtd/cakephp-search | src/Event/Model/WidgetsListener.php | WidgetsListener.getSavedSearchWidgets | private function getSavedSearchWidgets(): array
{
$table = TableRegistry::get('Search.SavedSearches');
$query = $table->find('all')
->where([
'SavedSearches.name IS NOT' => null,
'SavedSearches.name !=' => '',
'SavedSearches.system' => fal... | php | private function getSavedSearchWidgets(): array
{
$table = TableRegistry::get('Search.SavedSearches');
$query = $table->find('all')
->where([
'SavedSearches.name IS NOT' => null,
'SavedSearches.name !=' => '',
'SavedSearches.system' => fal... | [
"private",
"function",
"getSavedSearchWidgets",
"(",
")",
":",
"array",
"{",
"$",
"table",
"=",
"TableRegistry",
"::",
"get",
"(",
"'Search.SavedSearches'",
")",
";",
"$",
"query",
"=",
"$",
"table",
"->",
"find",
"(",
"'all'",
")",
"->",
"where",
"(",
"... | Fetch all saved searches from the database.
@return mixed[] | [
"Fetch",
"all",
"saved",
"searches",
"from",
"the",
"database",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Event/Model/WidgetsListener.php#L58-L78 |
28,473 | QoboLtd/cakephp-search | src/Event/Model/WidgetsListener.php | WidgetsListener.getReportWidgets | private function getReportWidgets(): array
{
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS(), $this);
EventManager::instance()->dispatch($event);
if (empty($event->result)) {
return [];
}
$result = [];
foreach ($event->result as $rep... | php | private function getReportWidgets(): array
{
$event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS(), $this);
EventManager::instance()->dispatch($event);
if (empty($event->result)) {
return [];
}
$result = [];
foreach ($event->result as $rep... | [
"private",
"function",
"getReportWidgets",
"(",
")",
":",
"array",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"(",
"string",
")",
"EventName",
"::",
"MODEL_DASHBOARDS_GET_REPORTS",
"(",
")",
",",
"$",
"this",
")",
";",
"EventManager",
"::",
"instance",
"... | Fetch all reports through Event broadcast.
@return mixed[] | [
"Fetch",
"all",
"reports",
"through",
"Event",
"broadcast",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Event/Model/WidgetsListener.php#L85-L105 |
28,474 | QoboLtd/cakephp-search | src/Event/Model/WidgetsListener.php | WidgetsListener.getAppWidgets | private function getAppWidgets(): array
{
$table = TableRegistry::get('Search.AppWidgets');
$query = $table->find('all')
->select(['id', 'name', 'content']);
if ($query->isEmpty()) {
return [];
}
$data = [];
// normalize app widget data
... | php | private function getAppWidgets(): array
{
$table = TableRegistry::get('Search.AppWidgets');
$query = $table->find('all')
->select(['id', 'name', 'content']);
if ($query->isEmpty()) {
return [];
}
$data = [];
// normalize app widget data
... | [
"private",
"function",
"getAppWidgets",
"(",
")",
":",
"array",
"{",
"$",
"table",
"=",
"TableRegistry",
"::",
"get",
"(",
"'Search.AppWidgets'",
")",
";",
"$",
"query",
"=",
"$",
"table",
"->",
"find",
"(",
"'all'",
")",
"->",
"select",
"(",
"[",
"'id... | Returns list of widgets defined in the application scope.
@return mixed[] | [
"Returns",
"list",
"of",
"widgets",
"defined",
"in",
"the",
"application",
"scope",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Event/Model/WidgetsListener.php#L112-L137 |
28,475 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi.php | JsonApi.create | public static function create( \Aimeos\MShop\Context\Item\Iface $context, $path, $name = null )
{
$path = trim( $path, '/' );
if( empty( $path ) ) {
return self::createRoot( $context, $path, $name );
}
$parts = explode( '/', $path );
foreach( $parts as $key => $part )
{
if( ctype_alnum( $part ) ==... | php | public static function create( \Aimeos\MShop\Context\Item\Iface $context, $path, $name = null )
{
$path = trim( $path, '/' );
if( empty( $path ) ) {
return self::createRoot( $context, $path, $name );
}
$parts = explode( '/', $path );
foreach( $parts as $key => $part )
{
if( ctype_alnum( $part ) ==... | [
"public",
"static",
"function",
"create",
"(",
"\\",
"Aimeos",
"\\",
"MShop",
"\\",
"Context",
"\\",
"Item",
"\\",
"Iface",
"$",
"context",
",",
"$",
"path",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"trim",
"(",
"$",
"path",
",",
... | Creates the required client specified by the given path of client names
Clients are created by providing only the domain name, e.g. "product"
for the \Aimeos\Client\JsonApi\Product\Standard or a path of names to
retrieve a specific sub-client, e.g. "product/type" for the
\Aimeos\Client\JsonApi\Product\Type\Standard cl... | [
"Creates",
"the",
"required",
"client",
"specified",
"by",
"the",
"given",
"path",
"of",
"client",
"names"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi.php#L36-L71 |
28,476 | BabDev/Transifex-API | src/Connector/Languageinfo.php | Languageinfo.getLanguage | public function getLanguage(string $lang): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
} | php | public function getLanguage(string $lang): ResponseInterface
{
return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
} | [
"public",
"function",
"getLanguage",
"(",
"string",
"$",
"lang",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"createRequest",
"(",
"'GET'",
",",
"$",
"this",
"->",
"createUri",
"("... | Get data on the specified language.
@param string $lang The language code to retrieve
@return ResponseInterface | [
"Get",
"data",
"on",
"the",
"specified",
"language",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Languageinfo.php#L22-L25 |
28,477 | BabDev/Transifex-API | src/Connector/Translationstrings.php | Translationstrings.getStrings | public function getStrings(
string $project,
string $resource,
string $lang,
bool $details = false,
array $options = []
): ResponseInterface {
$uri = $this->createUri("/api/2/project/$project/resource/$resource/translation/$lang/strings/");
$query = [];
... | php | public function getStrings(
string $project,
string $resource,
string $lang,
bool $details = false,
array $options = []
): ResponseInterface {
$uri = $this->createUri("/api/2/project/$project/resource/$resource/translation/$lang/strings/");
$query = [];
... | [
"public",
"function",
"getStrings",
"(",
"string",
"$",
"project",
",",
"string",
"$",
"resource",
",",
"string",
"$",
"lang",
",",
"bool",
"$",
"details",
"=",
"false",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ResponseInterface",
"{",
"... | Method to get the translation strings 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 bool $details Flag to retrieve additional details on t... | [
"Method",
"to",
"get",
"the",
"translation",
"strings",
"on",
"a",
"specified",
"resource",
"."
] | 9e0ccd7980127db88f7c55a36afbd2a49d9e8436 | https://github.com/BabDev/Transifex-API/blob/9e0ccd7980127db88f7c55a36afbd2a49d9e8436/src/Connector/Translationstrings.php#L39-L71 |
28,478 | techdivision/import-category | src/Subjects/BunchSubject.php | BunchSubject.getDisplayModeByValue | public function getDisplayModeByValue($displayMode)
{
// query whether or not, the requested display mode is available
if (isset($this->availableDisplayModes[$displayMode])) {
return $this->availableDisplayModes[$displayMode];
}
// throw an exception, if not
thr... | php | public function getDisplayModeByValue($displayMode)
{
// query whether or not, the requested display mode is available
if (isset($this->availableDisplayModes[$displayMode])) {
return $this->availableDisplayModes[$displayMode];
}
// throw an exception, if not
thr... | [
"public",
"function",
"getDisplayModeByValue",
"(",
"$",
"displayMode",
")",
"{",
"// query whether or not, the requested display mode is available",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"availableDisplayModes",
"[",
"$",
"displayMode",
"]",
")",
")",
"{",
"ret... | Return's the display mode for the passed display mode string.
@param string $displayMode The display mode string to return the key for
@return integer The requested display mode
@throws \Exception Is thrown, if the requested display mode is not available | [
"Return",
"s",
"the",
"display",
"mode",
"for",
"the",
"passed",
"display",
"mode",
"string",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/BunchSubject.php#L146-L156 |
28,479 | techdivision/import-category | src/Subjects/BunchSubject.php | BunchSubject.getPageLayoutByValue | public function getPageLayoutByValue($pageLayout)
{
// query whether or not, the requested display mode is available
if (isset($this->availablePageLayouts[$pageLayout])) {
return $this->availablePageLayouts[$pageLayout];
}
// throw an exception, if not
throw new... | php | public function getPageLayoutByValue($pageLayout)
{
// query whether or not, the requested display mode is available
if (isset($this->availablePageLayouts[$pageLayout])) {
return $this->availablePageLayouts[$pageLayout];
}
// throw an exception, if not
throw new... | [
"public",
"function",
"getPageLayoutByValue",
"(",
"$",
"pageLayout",
")",
"{",
"// query whether or not, the requested display mode is available",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"availablePageLayouts",
"[",
"$",
"pageLayout",
"]",
")",
")",
"{",
"return"... | Return's the page layout for the passed page layout string.
@param string $pageLayout The page layout string to return the key for
@return integer The requested page layout
@throws \Exception Is thrown, if the requested page layout is not available | [
"Return",
"s",
"the",
"page",
"layout",
"for",
"the",
"passed",
"page",
"layout",
"string",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/BunchSubject.php#L166-L176 |
28,480 | techdivision/import-category | src/Subjects/BunchSubject.php | BunchSubject.getRootCategoryStoreViewCodes | public function getRootCategoryStoreViewCodes($path)
{
// explode the path of the root category
list ($rootCategoryPath, ) = explode('/', $path);
// query whether or not a root category with the given path exists
if ($rootCategory = $this->getCategoryByPath($rootCategoryPath)) {
... | php | public function getRootCategoryStoreViewCodes($path)
{
// explode the path of the root category
list ($rootCategoryPath, ) = explode('/', $path);
// query whether or not a root category with the given path exists
if ($rootCategory = $this->getCategoryByPath($rootCategoryPath)) {
... | [
"public",
"function",
"getRootCategoryStoreViewCodes",
"(",
"$",
"path",
")",
"{",
"// explode the path of the root category",
"list",
"(",
"$",
"rootCategoryPath",
",",
")",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"// query whether or not a root categ... | Returns the store view codes relevant to the category represented by the current row.
@param string $path The path to return the root category's store view codes for
@return array The store view codes for the given root category
@throws \Exception Is thrown, if the root category of the passed path is NOT available | [
"Returns",
"the",
"store",
"view",
"codes",
"relevant",
"to",
"the",
"category",
"represented",
"by",
"the",
"current",
"row",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/BunchSubject.php#L196-L221 |
28,481 | hiqdev/hipanel-module-finance | src/cart/AbstractCartPosition.php | AbstractCartPosition.serializationMap | protected function serializationMap()
{
return [
'attributes' => $this->getAttributes(),
'_quantity' => $this->_quantity,
'_price' => $this->_price,
'_value' => $this->_value,
'_id' => $this->_id,
];
} | php | protected function serializationMap()
{
return [
'attributes' => $this->getAttributes(),
'_quantity' => $this->_quantity,
'_price' => $this->_price,
'_value' => $this->_value,
'_id' => $this->_id,
];
} | [
"protected",
"function",
"serializationMap",
"(",
")",
"{",
"return",
"[",
"'attributes'",
"=>",
"$",
"this",
"->",
"getAttributes",
"(",
")",
",",
"'_quantity'",
"=>",
"$",
"this",
"->",
"_quantity",
",",
"'_price'",
"=>",
"$",
"this",
"->",
"_price",
","... | Method stores map of attributes that must be serialized.
@return array key is the attribute name where the value should be extracted
In case when the value shoule be assigned in a special way, use [[unserializationMap]]
to map key to a closure, that will set the value
@see unserializationMap | [
"Method",
"stores",
"map",
"of",
"attributes",
"that",
"must",
"be",
"serialized",
"."
] | fa027420ddc1d6de22a6d830e14dde587c837220 | https://github.com/hiqdev/hipanel-module-finance/blob/fa027420ddc1d6de22a6d830e14dde587c837220/src/cart/AbstractCartPosition.php#L188-L197 |
28,482 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Product/Standard.php | Standard.aggregate | protected function aggregate( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response )
{
$view->data = $this->getController( $view )->sort()
->slice( $view->param( 'page/offset', 0 ), $view->param( 'page/limit', 10000 ) )
->aggregate( $view->param( 'aggregate' ) );
return ... | php | protected function aggregate( \Aimeos\MW\View\Iface $view, ServerRequestInterface $request, ResponseInterface $response )
{
$view->data = $this->getController( $view )->sort()
->slice( $view->param( 'page/offset', 0 ), $view->param( 'page/limit', 10000 ) )
->aggregate( $view->param( 'aggregate' ) );
return ... | [
"protected",
"function",
"aggregate",
"(",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"View",
"\\",
"Iface",
"$",
"view",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"view",
"->",
"data",
"=",
"$",
"this"... | Counts the number of products for the requested key
@param \Aimeos\MW\View\Iface $view View instance
@param \Psr\Http\Message\ServerRequestInterface $request Request object
@param \Psr\Http\Message\ResponseInterface $response Response object
@return \Psr\Http\Message\ResponseInterface Modified response object | [
"Counts",
"the",
"number",
"of",
"products",
"for",
"the",
"requested",
"key"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Product/Standard.php#L202-L209 |
28,483 | aimeos/ai-client-jsonapi | client/jsonapi/src/Client/JsonApi/Product/Standard.php | Standard.getController | protected function getController( \Aimeos\MW\View\Iface $view )
{
$context = $this->getContext();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );
/** client/jsonapi/product/levels
* Include products of sub-categories in the product list of the current category
*
* Sometimes it may b... | php | protected function getController( \Aimeos\MW\View\Iface $view )
{
$context = $this->getContext();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );
/** client/jsonapi/product/levels
* Include products of sub-categories in the product list of the current category
*
* Sometimes it may b... | [
"protected",
"function",
"getController",
"(",
"\\",
"Aimeos",
"\\",
"MW",
"\\",
"View",
"\\",
"Iface",
"$",
"view",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
";",
"$",
"cntl",
"=",
"\\",
"Aimeos",
"\\",
"Controller",
... | Returns the initialized product controller
@param \Aimeos\MW\View\Iface $view View instance
@return \Aimeos\Controller\Frontend\Product\Iface Initialized product controller | [
"Returns",
"the",
"initialized",
"product",
"controller"
] | b0dfb018ae0a1f7196b18322e28a1b3224aa9045 | https://github.com/aimeos/ai-client-jsonapi/blob/b0dfb018ae0a1f7196b18322e28a1b3224aa9045/client/jsonapi/src/Client/JsonApi/Product/Standard.php#L218-L270 |
28,484 | mmoreram/ControllerExtraBundle | Resolver/AnnotationResolver.php | AnnotationResolver.getParameterType | public function getParameterType(
ReflectionMethod $method,
string $parameterName,
? string $default = null
) : ? string {
$parameters = $method->getParameters();
foreach ($parameters as $parameter) {
if ($parameter->getName() === $parameterName) {
... | php | public function getParameterType(
ReflectionMethod $method,
string $parameterName,
? string $default = null
) : ? string {
$parameters = $method->getParameters();
foreach ($parameters as $parameter) {
if ($parameter->getName() === $parameterName) {
... | [
"public",
"function",
"getParameterType",
"(",
"ReflectionMethod",
"$",
"method",
",",
"string",
"$",
"parameterName",
",",
"?",
"string",
"$",
"default",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"parameters",
"=",
"$",
"method",
"->",
"getParameters"... | Return parameter type.
@param ReflectionMethod $method
@param string $parameterName
@param string|null $default
@return string|null | [
"Return",
"parameter",
"type",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/AnnotationResolver.php#L37-L55 |
28,485 | MetaModels/filter_perimetersearch | src/FilterHelper/ProviderInterface.php | ProviderInterface.getFullCountryName | public function getFullCountryName($shortTag)
{
$countries = $this->getCountries();
if (\array_key_exists($shortTag, $countries)) {
return $countries[$shortTag];
}
return null;
} | php | public function getFullCountryName($shortTag)
{
$countries = $this->getCountries();
if (\array_key_exists($shortTag, $countries)) {
return $countries[$shortTag];
}
return null;
} | [
"public",
"function",
"getFullCountryName",
"(",
"$",
"shortTag",
")",
"{",
"$",
"countries",
"=",
"$",
"this",
"->",
"getCountries",
"(",
")",
";",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"shortTag",
",",
"$",
"countries",
")",
")",
"{",
"return"... | Search the full name of a country.
@param string $shortTag The short tag for the country.
@return null|string Null on error or the full name as string. | [
"Search",
"the",
"full",
"name",
"of",
"a",
"country",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterHelper/ProviderInterface.php#L51-L59 |
28,486 | MetaModels/filter_perimetersearch | src/FilterHelper/ProviderInterface.php | ProviderInterface.getQueryString | public function getQueryString(
$street = null,
$postal = null,
$city = null,
$country = null,
$fullAddress = null
) {
// If we have a full address use it.
if ($fullAddress) {
// If there is a country try to use the long form.
if ((null... | php | public function getQueryString(
$street = null,
$postal = null,
$city = null,
$country = null,
$fullAddress = null
) {
// If we have a full address use it.
if ($fullAddress) {
// If there is a country try to use the long form.
if ((null... | [
"public",
"function",
"getQueryString",
"(",
"$",
"street",
"=",
"null",
",",
"$",
"postal",
"=",
"null",
",",
"$",
"city",
"=",
"null",
",",
"$",
"country",
"=",
"null",
",",
"$",
"fullAddress",
"=",
"null",
")",
"{",
"// If we have a full address use it.... | Build the query string.
@param string $street The street.
@param string $postal The postal code.
@param string $city Name of city.
@param string $country A 2-letter country code.
@param string $fullAddress Address string without specific format.
@return string | [
"Build",
"the",
"query",
"string",
"."
] | 953d55881a1855972c5f47a7552863986702163c | https://github.com/MetaModels/filter_perimetersearch/blob/953d55881a1855972c5f47a7552863986702163c/src/FilterHelper/ProviderInterface.php#L72-L107 |
28,487 | mmoreram/ControllerExtraBundle | Provider/RequestParameterProvider.php | RequestParameterProvider.resolveValueFromParameterBag | protected function resolveValueFromParameterBag(
ParameterBag $parameterBag,
string $delimiter,
string $value
) {
$trimmedValue = trim($value, $delimiter);
if (
($delimiter . $trimmedValue . $delimiter === $value) &&
$parameterBag->has($trimmedValue)
... | php | protected function resolveValueFromParameterBag(
ParameterBag $parameterBag,
string $delimiter,
string $value
) {
$trimmedValue = trim($value, $delimiter);
if (
($delimiter . $trimmedValue . $delimiter === $value) &&
$parameterBag->has($trimmedValue)
... | [
"protected",
"function",
"resolveValueFromParameterBag",
"(",
"ParameterBag",
"$",
"parameterBag",
",",
"string",
"$",
"delimiter",
",",
"string",
"$",
"value",
")",
"{",
"$",
"trimmedValue",
"=",
"trim",
"(",
"$",
"value",
",",
"$",
"delimiter",
")",
";",
"... | Given a bag and a delimiter, return the resolved value.
@param ParameterBag $parameterBag
@param string $delimiter
@param string $value
@return mixed | [
"Given",
"a",
"bag",
"and",
"a",
"delimiter",
"return",
"the",
"resolved",
"value",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Provider/RequestParameterProvider.php#L124-L139 |
28,488 | techdivision/import-category | src/Subjects/AbstractCategorySubject.php | AbstractCategorySubject.getRowStoreId | public function getRowStoreId($default = null)
{
// initialize the default store view code, if not passed
if ($default == null) {
$defaultStore = $this->getDefaultStore();
$default = $defaultStore[MemberNames::CODE];
}
// load the store view code the create ... | php | public function getRowStoreId($default = null)
{
// initialize the default store view code, if not passed
if ($default == null) {
$defaultStore = $this->getDefaultStore();
$default = $defaultStore[MemberNames::CODE];
}
// load the store view code the create ... | [
"public",
"function",
"getRowStoreId",
"(",
"$",
"default",
"=",
"null",
")",
"{",
"// initialize the default store view code, if not passed",
"if",
"(",
"$",
"default",
"==",
"null",
")",
"{",
"$",
"defaultStore",
"=",
"$",
"this",
"->",
"getDefaultStore",
"(",
... | Return's the store ID of the actual row, or of the default store
if no store view code is set in the CSV file.
@param string|null $default The default store view code to use, if no store view code is set in the CSV file
@return integer The ID of the actual store
@throws \Exception Is thrown, if the store with the act... | [
"Return",
"s",
"the",
"store",
"ID",
"of",
"the",
"actual",
"row",
"or",
"of",
"the",
"default",
"store",
"if",
"no",
"store",
"view",
"code",
"is",
"set",
"in",
"the",
"CSV",
"file",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/AbstractCategorySubject.php#L349-L368 |
28,489 | techdivision/import-category | src/Subjects/AbstractCategorySubject.php | AbstractCategorySubject.getStoreWebsiteIdByCode | public function getStoreWebsiteIdByCode($code)
{
// query whether or not, the requested store website is available
if (isset($this->storeWebsites[$code])) {
return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
}
// throw an exception, if not
th... | php | public function getStoreWebsiteIdByCode($code)
{
// query whether or not, the requested store website is available
if (isset($this->storeWebsites[$code])) {
return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
}
// throw an exception, if not
th... | [
"public",
"function",
"getStoreWebsiteIdByCode",
"(",
"$",
"code",
")",
"{",
"// query whether or not, the requested store website is available",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storeWebsites",
"[",
"$",
"code",
"]",
")",
")",
"{",
"return",
"(",
"int... | Return's the store website for the passed code.
@param string $code The code of the store website to return the ID for
@return integer The store website ID
@throws \Exception Is thrown, if the store website with the requested code is not available | [
"Return",
"s",
"the",
"store",
"website",
"for",
"the",
"passed",
"code",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/AbstractCategorySubject.php#L378-L388 |
28,490 | techdivision/import-category | src/Subjects/AbstractCategorySubject.php | AbstractCategorySubject.updateCategory | public function updateCategory($path, $category)
{
$this->categories[$path] = array_merge($this->categories[$path], $category);
} | php | public function updateCategory($path, $category)
{
$this->categories[$path] = array_merge($this->categories[$path], $category);
} | [
"public",
"function",
"updateCategory",
"(",
"$",
"path",
",",
"$",
"category",
")",
"{",
"$",
"this",
"->",
"categories",
"[",
"$",
"path",
"]",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"categories",
"[",
"$",
"path",
"]",
",",
"$",
"category",
"... | Updates the category with the passed path.
@param string $path The path of the category to update
@param array $category The category data to update
@return void
@deprecated Since 7.0.0 | [
"Updates",
"the",
"category",
"with",
"the",
"passed",
"path",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Subjects/AbstractCategorySubject.php#L435-L438 |
28,491 | techdivision/import-category | src/Plugins/ChildrenCountPlugin.php | ChildrenCountPlugin.process | public function process()
{
// load all available categories
$categories = $this->getImportProcessor()->getCategories();
// update the categories children count
foreach ($categories as $category) {
// load the category itself
$this->category = $this->loadCat... | php | public function process()
{
// load all available categories
$categories = $this->getImportProcessor()->getCategories();
// update the categories children count
foreach ($categories as $category) {
// load the category itself
$this->category = $this->loadCat... | [
"public",
"function",
"process",
"(",
")",
"{",
"// load all available categories",
"$",
"categories",
"=",
"$",
"this",
"->",
"getImportProcessor",
"(",
")",
"->",
"getCategories",
"(",
")",
";",
"// update the categories children count",
"foreach",
"(",
"$",
"cate... | Process the plugin functionality.
@return void
@throws \Exception Is thrown, if the plugin can not be processed | [
"Process",
"the",
"plugin",
"functionality",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Plugins/ChildrenCountPlugin.php#L70-L89 |
28,492 | mmoreram/ControllerExtraBundle | Resolver/PaginatorAnnotationResolver.php | PaginatorAnnotationResolver.createQueryBuilder | private function createQueryBuilder(string $entityNamespace) : QueryBuilder
{
return $this
->doctrine
->getManagerForClass($entityNamespace)
->createQueryBuilder()
->select(['x'])
->from($entityNamespace, 'x');
} | php | private function createQueryBuilder(string $entityNamespace) : QueryBuilder
{
return $this
->doctrine
->getManagerForClass($entityNamespace)
->createQueryBuilder()
->select(['x'])
->from($entityNamespace, 'x');
} | [
"private",
"function",
"createQueryBuilder",
"(",
"string",
"$",
"entityNamespace",
")",
":",
"QueryBuilder",
"{",
"return",
"$",
"this",
"->",
"doctrine",
"->",
"getManagerForClass",
"(",
"$",
"entityNamespace",
")",
"->",
"createQueryBuilder",
"(",
")",
"->",
... | Generate QueryBuilder.
@param string $entityNamespace
@return QueryBuilder | [
"Generate",
"QueryBuilder",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/PaginatorAnnotationResolver.php#L250-L258 |
28,493 | mmoreram/ControllerExtraBundle | Resolver/PaginatorAnnotationResolver.php | PaginatorAnnotationResolver.evaluateAttributes | private function evaluateAttributes(
Request $request,
CreatePaginator $annotation,
DoctrinePaginator $paginator,
int $limitPerPage,
int $page
) {
if ($annotation->getAttributes()) {
$total = $paginator->count();
$paginatorAttributes = new Pagi... | php | private function evaluateAttributes(
Request $request,
CreatePaginator $annotation,
DoctrinePaginator $paginator,
int $limitPerPage,
int $page
) {
if ($annotation->getAttributes()) {
$total = $paginator->count();
$paginatorAttributes = new Pagi... | [
"private",
"function",
"evaluateAttributes",
"(",
"Request",
"$",
"request",
",",
"CreatePaginator",
"$",
"annotation",
",",
"DoctrinePaginator",
"$",
"paginator",
",",
"int",
"$",
"limitPerPage",
",",
"int",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"annotation"... | Evaluates Paginator attributes.
@param Request $request
@param CreatePaginator $annotation
@param DoctrinePaginator $paginator
@param int $limitPerPage
@param int $page | [
"Evaluates",
"Paginator",
"attributes",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/PaginatorAnnotationResolver.php#L269-L290 |
28,494 | mmoreram/ControllerExtraBundle | Resolver/PaginatorAnnotationResolver.php | PaginatorAnnotationResolver.decidePaginatorFormat | private function decidePaginatorFormat(
DoctrinePaginator $paginator,
string $parameterType,
int $limitPerPage,
int $page
) {
if (Pagerfanta::class === $parameterType) {
$paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
$pagi... | php | private function decidePaginatorFormat(
DoctrinePaginator $paginator,
string $parameterType,
int $limitPerPage,
int $page
) {
if (Pagerfanta::class === $parameterType) {
$paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
$pagi... | [
"private",
"function",
"decidePaginatorFormat",
"(",
"DoctrinePaginator",
"$",
"paginator",
",",
"string",
"$",
"parameterType",
",",
"int",
"$",
"limitPerPage",
",",
"int",
"$",
"page",
")",
"{",
"if",
"(",
"Pagerfanta",
"::",
"class",
"===",
"$",
"parameterT... | Return real usable Paginator instance given the definition type.
@param DoctrinePaginator $paginator
@param string $parameterType
@param int $limitPerPage
@param int $page
@return mixed | [
"Return",
"real",
"usable",
"Paginator",
"instance",
"given",
"the",
"definition",
"type",
"."
] | b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3 | https://github.com/mmoreram/ControllerExtraBundle/blob/b5841b6ca8f0022a2d88fdfbf743f0b76c4644e3/Resolver/PaginatorAnnotationResolver.php#L302-L319 |
28,495 | techdivision/import-category | src/Repositories/CategoryRepository.php | CategoryRepository.countChildren | public function countChildren($path)
{
// load and return the category with the passed path
$this->categoryCountChildrenStmt->execute(array(MemberNames::PATH => $path));
return $this->categoryCountChildrenStmt->fetchColumn();
} | php | public function countChildren($path)
{
// load and return the category with the passed path
$this->categoryCountChildrenStmt->execute(array(MemberNames::PATH => $path));
return $this->categoryCountChildrenStmt->fetchColumn();
} | [
"public",
"function",
"countChildren",
"(",
"$",
"path",
")",
"{",
"// load and return the category with the passed path",
"$",
"this",
"->",
"categoryCountChildrenStmt",
"->",
"execute",
"(",
"array",
"(",
"MemberNames",
"::",
"PATH",
"=>",
"$",
"path",
")",
")",
... | Return's the children count of the category with the passed path.
@param string $path The path of the category to count the children for
@return integer The children count of the category with the passed path | [
"Return",
"s",
"the",
"children",
"count",
"of",
"the",
"category",
"with",
"the",
"passed",
"path",
"."
] | 6e4dfba08c69fd051587cbdeb92c9a9606d956ee | https://github.com/techdivision/import-category/blob/6e4dfba08c69fd051587cbdeb92c9a9606d956ee/src/Repositories/CategoryRepository.php#L114-L119 |
28,496 | QoboLtd/cakephp-search | src/Utility/Validator.php | Validator.validateData | public static function validateData(RepositoryInterface $table, array $data, array $user): array
{
$fields = Utility::instance()->getSearchableFields($table, $user);
$fields = array_keys($fields);
// merge default options
$data += Options::getDefaults($table);
if (!empty($d... | php | public static function validateData(RepositoryInterface $table, array $data, array $user): array
{
$fields = Utility::instance()->getSearchableFields($table, $user);
$fields = array_keys($fields);
// merge default options
$data += Options::getDefaults($table);
if (!empty($d... | [
"public",
"static",
"function",
"validateData",
"(",
"RepositoryInterface",
"$",
"table",
",",
"array",
"$",
"data",
",",
"array",
"$",
"user",
")",
":",
"array",
"{",
"$",
"fields",
"=",
"Utility",
"::",
"instance",
"(",
")",
"->",
"getSearchableFields",
... | Base search data validation method.
Retrieves current searchable table columns, validates and filters criteria, display columns
and sort by field against them. Then validates sort by order againt available options
and sets it to the default option if they fail validation.
@param \Cake\Datasource\RepositoryInterface $... | [
"Base",
"search",
"data",
"validation",
"method",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Validator.php#L40-L63 |
28,497 | QoboLtd/cakephp-search | src/Utility/Validator.php | Validator.validateCriteria | protected static function validateCriteria(array $data, array $fields): array
{
foreach (array_keys($data) as $key) {
if (in_array($key, $fields)) {
continue;
}
unset($data[$key]);
}
return $data;
} | php | protected static function validateCriteria(array $data, array $fields): array
{
foreach (array_keys($data) as $key) {
if (in_array($key, $fields)) {
continue;
}
unset($data[$key]);
}
return $data;
} | [
"protected",
"static",
"function",
"validateCriteria",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"fields",
")",
":",
"array",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"data",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"... | Validate search criteria.
@param mixed[] $data Criteria values
@param mixed[] $fields Searchable fields
@return mixed[] | [
"Validate",
"search",
"criteria",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Validator.php#L72-L82 |
28,498 | QoboLtd/cakephp-search | src/Utility/Validator.php | Validator.validateSortByField | protected static function validateSortByField(string $data, array $fields, array $displayColumns, RepositoryInterface $table): string
{
/** @var \Cake\ORM\Table */
$table = $table;
// use sort field if is searchable
if (in_array($data, $fields)) {
return $data;
}
... | php | protected static function validateSortByField(string $data, array $fields, array $displayColumns, RepositoryInterface $table): string
{
/** @var \Cake\ORM\Table */
$table = $table;
// use sort field if is searchable
if (in_array($data, $fields)) {
return $data;
}
... | [
"protected",
"static",
"function",
"validateSortByField",
"(",
"string",
"$",
"data",
",",
"array",
"$",
"fields",
",",
"array",
"$",
"displayColumns",
",",
"RepositoryInterface",
"$",
"table",
")",
":",
"string",
"{",
"/** @var \\Cake\\ORM\\Table */",
"$",
"table... | Validate search sort by field.
@param string $data Sort by field value
@param mixed[] $fields Searchable fields
@param mixed[] $displayColumns Display columns
@param \Cake\Datasource\RepositoryInterface $table Table instance
@return string | [
"Validate",
"search",
"sort",
"by",
"field",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Validator.php#L112-L142 |
28,499 | QoboLtd/cakephp-search | src/Utility/Validator.php | Validator.validateSortByOrder | protected static function validateSortByOrder(string $data): string
{
$options = array_keys(Options::getSortByOrders());
if (!in_array($data, $options)) {
$data = Options::DEFAULT_SORT_BY_ORDER;
}
return $data;
} | php | protected static function validateSortByOrder(string $data): string
{
$options = array_keys(Options::getSortByOrders());
if (!in_array($data, $options)) {
$data = Options::DEFAULT_SORT_BY_ORDER;
}
return $data;
} | [
"protected",
"static",
"function",
"validateSortByOrder",
"(",
"string",
"$",
"data",
")",
":",
"string",
"{",
"$",
"options",
"=",
"array_keys",
"(",
"Options",
"::",
"getSortByOrders",
"(",
")",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"data",
"... | Validate search sort by order.
@param string $data Sort by order value
@return string | [
"Validate",
"search",
"sort",
"by",
"order",
"."
] | 095a0e822781ac11eade0c03c7729b693daa1ba8 | https://github.com/QoboLtd/cakephp-search/blob/095a0e822781ac11eade0c03c7729b693daa1ba8/src/Utility/Validator.php#L150-L158 |
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.