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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
202,500 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.setTotalItems | private function setTotalItems($totalItems)
{
if (! is_int($totalItems)) {
throw new Exceptions\InvalidIntegerType(gettype($totalItems));
}
// A result may have zero or more items
if ($totalItems < 0) {
throw new Exceptions\PositiveIntegerRequired($totalItems... | php | private function setTotalItems($totalItems)
{
if (! is_int($totalItems)) {
throw new Exceptions\InvalidIntegerType(gettype($totalItems));
}
// A result may have zero or more items
if ($totalItems < 0) {
throw new Exceptions\PositiveIntegerRequired($totalItems... | [
"private",
"function",
"setTotalItems",
"(",
"$",
"totalItems",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"totalItems",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"InvalidIntegerType",
"(",
"gettype",
"(",
"$",
"totalItems",
")",
")",
";",
"}... | Stores the total amount of items.
@param int $totalItems
@throws Exceptions\InvalidIntegerType
@throws Exceptions\PositiveIntegerRequired | [
"Stores",
"the",
"total",
"amount",
"of",
"items",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L143-L157 |
202,501 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.calculateTotalPages | private function calculateTotalPages()
{
// With zero items, there is still one page
if ($this->getTotalItems() === 0) {
$this->setTotalPages(1);
return;
}
// The total amount of pages is calculated by dividing the total amount of items by the items per page
... | php | private function calculateTotalPages()
{
// With zero items, there is still one page
if ($this->getTotalItems() === 0) {
$this->setTotalPages(1);
return;
}
// The total amount of pages is calculated by dividing the total amount of items by the items per page
... | [
"private",
"function",
"calculateTotalPages",
"(",
")",
"{",
"// With zero items, there is still one page",
"if",
"(",
"$",
"this",
"->",
"getTotalItems",
"(",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"setTotalPages",
"(",
"1",
")",
";",
"return",
";",
... | Calculates the total amount of pages. | [
"Calculates",
"the",
"total",
"amount",
"of",
"pages",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L170-L182 |
202,502 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.setPage | private function setPage($page)
{
if (! is_int($page)) {
throw new Exceptions\InvalidIntegerType(gettype($page));
}
// There is at least one page
if ($page <= 0) {
throw new Exceptions\PositiveIntegerRequired($page);
}
$this->page = $page;
... | php | private function setPage($page)
{
if (! is_int($page)) {
throw new Exceptions\InvalidIntegerType(gettype($page));
}
// There is at least one page
if ($page <= 0) {
throw new Exceptions\PositiveIntegerRequired($page);
}
$this->page = $page;
... | [
"private",
"function",
"setPage",
"(",
"$",
"page",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"page",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"InvalidIntegerType",
"(",
"gettype",
"(",
"$",
"page",
")",
")",
";",
"}",
"// There is at lea... | Stores the current page.
@param int $page
@throws Exceptions\InvalidIntegerType
@throws Exceptions\PositiveIntegerRequired | [
"Stores",
"the",
"current",
"page",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L199-L213 |
202,503 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.calculateOffset | private function calculateOffset()
{
// When no limit is provided, all items are on one page, so the offset is unreasonable
if (! $this->hasLimit()) {
$this->setOffset(0);
return;
}
$offset = ($this->getPage() * $this->getLimit()) - $this->getLimit();
... | php | private function calculateOffset()
{
// When no limit is provided, all items are on one page, so the offset is unreasonable
if (! $this->hasLimit()) {
$this->setOffset(0);
return;
}
$offset = ($this->getPage() * $this->getLimit()) - $this->getLimit();
... | [
"private",
"function",
"calculateOffset",
"(",
")",
"{",
"// When no limit is provided, all items are on one page, so the offset is unreasonable",
"if",
"(",
"!",
"$",
"this",
"->",
"hasLimit",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setOffset",
"(",
"0",
")",
";",
... | Calculates the offset for the current page and limit. | [
"Calculates",
"the",
"offset",
"for",
"the",
"current",
"page",
"and",
"limit",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L228-L239 |
202,504 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.calculateFirstItemOnPage | private function calculateFirstItemOnPage()
{
// When an offset is used, increase the first item with 1
$offsetItem = $this->getOffset() !== 0 ? 1 : 0;
// When there are a total amount of items and the offset is zero, increase 1
if ($this->getTotalItems() !== 0 && $offsetItem === 0)... | php | private function calculateFirstItemOnPage()
{
// When an offset is used, increase the first item with 1
$offsetItem = $this->getOffset() !== 0 ? 1 : 0;
// When there are a total amount of items and the offset is zero, increase 1
if ($this->getTotalItems() !== 0 && $offsetItem === 0)... | [
"private",
"function",
"calculateFirstItemOnPage",
"(",
")",
"{",
"// When an offset is used, increase the first item with 1",
"$",
"offsetItem",
"=",
"$",
"this",
"->",
"getOffset",
"(",
")",
"!==",
"0",
"?",
"1",
":",
"0",
";",
"// When there are a total amount of ite... | Calculates which item number is the first on the current page. | [
"Calculates",
"which",
"item",
"number",
"is",
"the",
"first",
"on",
"the",
"current",
"page",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L244-L258 |
202,505 | vdhicts/dicms-pagination | src/Pagination.php | Pagination.calculateLastItemOnPage | private function calculateLastItemOnPage()
{
// When no limit, the last item is the total amount of items
if (! $this->hasLimit()) {
$this->setLastItemOnPage($this->getTotalItems());
return;
}
// Determine the last item on the page
$lastItem = $this->... | php | private function calculateLastItemOnPage()
{
// When no limit, the last item is the total amount of items
if (! $this->hasLimit()) {
$this->setLastItemOnPage($this->getTotalItems());
return;
}
// Determine the last item on the page
$lastItem = $this->... | [
"private",
"function",
"calculateLastItemOnPage",
"(",
")",
"{",
"// When no limit, the last item is the total amount of items",
"if",
"(",
"!",
"$",
"this",
"->",
"hasLimit",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setLastItemOnPage",
"(",
"$",
"this",
"->",
"get... | Calculates which item number is the last on the current page. | [
"Calculates",
"which",
"item",
"number",
"is",
"the",
"last",
"on",
"the",
"current",
"page",
"."
] | e280cb0015ffbe210bcf94acf68186fa5f31f122 | https://github.com/vdhicts/dicms-pagination/blob/e280cb0015ffbe210bcf94acf68186fa5f31f122/src/Pagination.php#L263-L278 |
202,506 | Eden-PHP/Block | Component.php | Component.alert | public function alert($message, $type = 'info')
{
Argument::i()
->test(2, 'string')
->test(3, 'string');
return Alert::i($message, $type);
} | php | public function alert($message, $type = 'info')
{
Argument::i()
->test(2, 'string')
->test(3, 'string');
return Alert::i($message, $type);
} | [
"public",
"function",
"alert",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"'info'",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"2",
",",
"'string'",
")",
"->",
"test",
"(",
"3",
",",
"'string'",
")",
";",
"return",
"Alert",
":... | Returns an alert
@param string
@param string
@return Eden\Block\Component\Alert | [
"Returns",
"an",
"alert"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L40-L47 |
202,507 | Eden-PHP/Block | Component.php | Component.hero | public function hero(array $images = array(), $delay = null)
{
Argument::i()->test(2, 'scalar', 'null');
$field = Hero::i()->setImages($images);
if(!is_null($delay) and is_numeric($delay) ) {
$field->setDelay($delay);
}
return $field;
} | php | public function hero(array $images = array(), $delay = null)
{
Argument::i()->test(2, 'scalar', 'null');
$field = Hero::i()->setImages($images);
if(!is_null($delay) and is_numeric($delay) ) {
$field->setDelay($delay);
}
return $field;
} | [
"public",
"function",
"hero",
"(",
"array",
"$",
"images",
"=",
"array",
"(",
")",
",",
"$",
"delay",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",
"'null'",
")",
";",
"$",
"field",
"=",
"... | Returns a hero
@param array
@param scalar|null
@return Eden\Block\Hero | [
"Returns",
"a",
"hero"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L66-L77 |
202,508 | Eden-PHP/Block | Component.php | Component.sort | public function sort(array $query, $key, $label, $url = null)
{
Argument::i()
->test(2, 'string')
->test(3, 'string')
->test(4, 'string', 'null');
$block = Sort::i($query, $key, $label);
if($url) {
$block->setUrl($url);
}
return $block;
} | php | public function sort(array $query, $key, $label, $url = null)
{
Argument::i()
->test(2, 'string')
->test(3, 'string')
->test(4, 'string', 'null');
$block = Sort::i($query, $key, $label);
if($url) {
$block->setUrl($url);
}
return $block;
} | [
"public",
"function",
"sort",
"(",
"array",
"$",
"query",
",",
"$",
"key",
",",
"$",
"label",
",",
"$",
"url",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"2",
",",
"'string'",
")",
"->",
"test",
"(",
"3",
",",
... | Returns table sort block
@param array
@param string
@param string
@param string|null
@return Eden\Block\Sort | [
"Returns",
"table",
"sort",
"block"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Component.php#L88-L102 |
202,509 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.setPlatform | public function setPlatform(PlatformInterface $platform)
{
$this->platform = $platform;
$this->createTableSQLCollector->setPlatform($platform);
$this->dropTableSQLCollector->setPlatform($platform);
$this->alterTableSQLCollector->setPlatform($platform);
$this->init();
} | php | public function setPlatform(PlatformInterface $platform)
{
$this->platform = $platform;
$this->createTableSQLCollector->setPlatform($platform);
$this->dropTableSQLCollector->setPlatform($platform);
$this->alterTableSQLCollector->setPlatform($platform);
$this->init();
} | [
"public",
"function",
"setPlatform",
"(",
"PlatformInterface",
"$",
"platform",
")",
"{",
"$",
"this",
"->",
"platform",
"=",
"$",
"platform",
";",
"$",
"this",
"->",
"createTableSQLCollector",
"->",
"setPlatform",
"(",
"$",
"platform",
")",
";",
"$",
"this"... | Sets the platform used to collect queries.
@param \Fridge\DBAL\Platform\PlatformInterface $platform The platform used to collect queries. | [
"Sets",
"the",
"platform",
"used",
"to",
"collect",
"queries",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L101-L110 |
202,510 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.init | public function init()
{
$this->createTableSQLCollector->init();
$this->dropTableSQLCollector->init();
$this->alterTableSQLCollector->init();
$this->dropSequenceQueries = array();
$this->dropViewQueries = array();
$this->createViewQueries = array();
$this->cr... | php | public function init()
{
$this->createTableSQLCollector->init();
$this->dropTableSQLCollector->init();
$this->alterTableSQLCollector->init();
$this->dropSequenceQueries = array();
$this->dropViewQueries = array();
$this->createViewQueries = array();
$this->cr... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"createTableSQLCollector",
"->",
"init",
"(",
")",
";",
"$",
"this",
"->",
"dropTableSQLCollector",
"->",
"init",
"(",
")",
";",
"$",
"this",
"->",
"alterTableSQLCollector",
"->",
"init",
"(",... | Reinitializes the SQL collector. | [
"Reinitializes",
"the",
"SQL",
"collector",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L115-L126 |
202,511 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.collect | public function collect(SchemaDiff $schemaDiff)
{
if ($schemaDiff->getOldAsset()->getName() !== $schemaDiff->getNewAsset()->getName()) {
$this->renameSchemaQueries = array_merge(
$this->renameSchemaQueries,
$this->platform->getRenameDatabaseSQLQueries($schemaDiff)... | php | public function collect(SchemaDiff $schemaDiff)
{
if ($schemaDiff->getOldAsset()->getName() !== $schemaDiff->getNewAsset()->getName()) {
$this->renameSchemaQueries = array_merge(
$this->renameSchemaQueries,
$this->platform->getRenameDatabaseSQLQueries($schemaDiff)... | [
"public",
"function",
"collect",
"(",
"SchemaDiff",
"$",
"schemaDiff",
")",
"{",
"if",
"(",
"$",
"schemaDiff",
"->",
"getOldAsset",
"(",
")",
"->",
"getName",
"(",
")",
"!==",
"$",
"schemaDiff",
"->",
"getNewAsset",
"(",
")",
"->",
"getName",
"(",
")",
... | Collects queries to alter a schema.
@param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference. | [
"Collects",
"queries",
"to",
"alter",
"a",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L133-L145 |
202,512 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.getQueries | public function getQueries()
{
return array_merge(
$this->getDropSequenceQueries(),
$this->getDropViewQueries(),
$this->getRenameTableQueries(),
$this->getDropCheckQueries(),
$this->getDropForeignKeyQueries(),
$this->getDropIndexQueries... | php | public function getQueries()
{
return array_merge(
$this->getDropSequenceQueries(),
$this->getDropViewQueries(),
$this->getRenameTableQueries(),
$this->getDropCheckQueries(),
$this->getDropForeignKeyQueries(),
$this->getDropIndexQueries... | [
"public",
"function",
"getQueries",
"(",
")",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"getDropSequenceQueries",
"(",
")",
",",
"$",
"this",
"->",
"getDropViewQueries",
"(",
")",
",",
"$",
"this",
"->",
"getRenameTableQueries",
"(",
")",
",",
... | Gets the queries to alter the schema.
@return array the queries to alter the schema. | [
"Gets",
"the",
"queries",
"to",
"alter",
"the",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L348-L371 |
202,513 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.collectTables | private function collectTables(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedTables() as $table) {
$this->createTableSQLCollector->collect($table);
}
foreach ($schemaDiff->getDroppedTables() as $table) {
$this->dropTableSQLCollector->collect($table);
... | php | private function collectTables(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedTables() as $table) {
$this->createTableSQLCollector->collect($table);
}
foreach ($schemaDiff->getDroppedTables() as $table) {
$this->dropTableSQLCollector->collect($table);
... | [
"private",
"function",
"collectTables",
"(",
"SchemaDiff",
"$",
"schemaDiff",
")",
"{",
"foreach",
"(",
"$",
"schemaDiff",
"->",
"getCreatedTables",
"(",
")",
"as",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"createTableSQLCollector",
"->",
"collect",
"(",
"... | Collects queries about tables to alter a schema.
@param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference. | [
"Collects",
"queries",
"about",
"tables",
"to",
"alter",
"a",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L378-L391 |
202,514 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.collectViews | private function collectViews(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedViews() as $view) {
$this->createViewQueries = array_merge(
$this->createViewQueries,
$this->platform->getCreateViewSQLQueries($view)
);
}
foreach ... | php | private function collectViews(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedViews() as $view) {
$this->createViewQueries = array_merge(
$this->createViewQueries,
$this->platform->getCreateViewSQLQueries($view)
);
}
foreach ... | [
"private",
"function",
"collectViews",
"(",
"SchemaDiff",
"$",
"schemaDiff",
")",
"{",
"foreach",
"(",
"$",
"schemaDiff",
"->",
"getCreatedViews",
"(",
")",
"as",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"createViewQueries",
"=",
"array_merge",
"(",
"$",
... | Collects queries about views to alter a schema.
@param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference. | [
"Collects",
"queries",
"about",
"views",
"to",
"alter",
"a",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L398-L413 |
202,515 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php | AlterSchemaSQLCollector.collectSequences | private function collectSequences(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedSequences() as $sequence) {
$this->createSequenceQueries = array_merge(
$this->createSequenceQueries,
$this->platform->getCreateSequenceSQLQueries($sequence)
);... | php | private function collectSequences(SchemaDiff $schemaDiff)
{
foreach ($schemaDiff->getCreatedSequences() as $sequence) {
$this->createSequenceQueries = array_merge(
$this->createSequenceQueries,
$this->platform->getCreateSequenceSQLQueries($sequence)
);... | [
"private",
"function",
"collectSequences",
"(",
"SchemaDiff",
"$",
"schemaDiff",
")",
"{",
"foreach",
"(",
"$",
"schemaDiff",
"->",
"getCreatedSequences",
"(",
")",
"as",
"$",
"sequence",
")",
"{",
"$",
"this",
"->",
"createSequenceQueries",
"=",
"array_merge",
... | Collects queries about sequences to a schema.
@param \Fridge\DBAL\Schema\Diff\SchemaDiff $schemaDiff The schema difference. | [
"Collects",
"queries",
"about",
"sequences",
"to",
"a",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/AlterSchemaSQLCollector.php#L420-L435 |
202,516 | wpdesk/wp-basic-requirements | src/Basic_Requirement_Checker.php | WPDesk_Basic_Requirement_Checker.is_wp_plugin_active | public static function is_wp_plugin_active( $plugin_file ) {
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) {
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
}
return in_array( $plugin_file, $active_plugins )... | php | public static function is_wp_plugin_active( $plugin_file ) {
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) {
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
}
return in_array( $plugin_file, $active_plugins )... | [
"public",
"static",
"function",
"is_wp_plugin_active",
"(",
"$",
"plugin_file",
")",
"{",
"$",
"active_plugins",
"=",
"(",
"array",
")",
"get_option",
"(",
"'active_plugins'",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"is_multisite",
"(",
")",
")",
"{",... | Checks if plugin is active. Needs to be enabled in deferred way.
@param string $plugin_file
@return bool | [
"Checks",
"if",
"plugin",
"is",
"active",
".",
"Needs",
"to",
"be",
"enabled",
"in",
"deferred",
"way",
"."
] | 57d76f5acf312f632210db71884f282d8fcf1838 | https://github.com/wpdesk/wp-basic-requirements/blob/57d76f5acf312f632210db71884f282d8fcf1838/src/Basic_Requirement_Checker.php#L279-L287 |
202,517 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.indexAction | public function indexAction($access)
{
$em = $this->getDoctrineManager();
$sf = $this->container->get('sakonnin.files');
// Todo: paging or just show the last 20
$files = $sf->getFilesForLoggedIn();
if ($this->isRest($access)) {
return $this->returnRestData($requ... | php | public function indexAction($access)
{
$em = $this->getDoctrineManager();
$sf = $this->container->get('sakonnin.files');
// Todo: paging or just show the last 20
$files = $sf->getFilesForLoggedIn();
if ($this->isRest($access)) {
return $this->returnRestData($requ... | [
"public",
"function",
"indexAction",
"(",
"$",
"access",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrineManager",
"(",
")",
";",
"$",
"sf",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'sakonnin.files'",
")",
";",
"// Todo: paging or... | Lists all file entities.
@Route("/", name="file_index", methods={"GET"}) | [
"Lists",
"all",
"file",
"entities",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L33-L45 |
202,518 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.newAction | public function newAction(Request $request, $access)
{
$file = new SakonninFile();
$form = $this->createCreateForm($file);
$data = $request->request->all();
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$sf = $this->container->g... | php | public function newAction(Request $request, $access)
{
$file = new SakonninFile();
$form = $this->createCreateForm($file);
$data = $request->request->all();
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$sf = $this->container->g... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
",",
"$",
"access",
")",
"{",
"$",
"file",
"=",
"new",
"SakonninFile",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"file",
")",
";",
"$",
"data",... | Creates a new file entity.
@Route("/new", name="file_new", methods={"GET", "POST"}) | [
"Creates",
"a",
"new",
"file",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L69-L97 |
202,519 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.showAction | public function showAction(Request $request, SakonninFile $file, $access)
{
$deleteForm = $this->createDeleteForm($file);
return $this->render('BisonLabSakonninBundle:SakonninFile:show.html.twig',
array(
'file' => $file,
'delete_form' => $deleteForm->createView()... | php | public function showAction(Request $request, SakonninFile $file, $access)
{
$deleteForm = $this->createDeleteForm($file);
return $this->render('BisonLabSakonninBundle:SakonninFile:show.html.twig',
array(
'file' => $file,
'delete_form' => $deleteForm->createView()... | [
"public",
"function",
"showAction",
"(",
"Request",
"$",
"request",
",",
"SakonninFile",
"$",
"file",
",",
"$",
"access",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"file",
")",
";",
"return",
"$",
"this",
"->",
... | Finds and displays a file entity.
@Route("/{id}", name="file_show", methods={"GET"}) | [
"Finds",
"and",
"displays",
"a",
"file",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L104-L113 |
202,520 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.viewAction | public function viewAction(Request $request, SakonninFile $file, $access)
{
// TODO: Add access control.
$path = $this->getFilePath();
$response = new BinaryFileResponse($path . "/" . $file->getStoredAs());
return $response;
} | php | public function viewAction(Request $request, SakonninFile $file, $access)
{
// TODO: Add access control.
$path = $this->getFilePath();
$response = new BinaryFileResponse($path . "/" . $file->getStoredAs());
return $response;
} | [
"public",
"function",
"viewAction",
"(",
"Request",
"$",
"request",
",",
"SakonninFile",
"$",
"file",
",",
"$",
"access",
")",
"{",
"// TODO: Add access control.",
"$",
"path",
"=",
"$",
"this",
"->",
"getFilePath",
"(",
")",
";",
"$",
"response",
"=",
"ne... | View a file.
@Route("/{id}/view", name="file_view", methods={"GET"}) | [
"View",
"a",
"file",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L134-L140 |
202,521 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.editAction | public function editAction(Request $request, SakonninFile $file, $access)
{
$deleteForm = $this->createDeleteForm($file);
$editForm = $this->createForm('BisonLab\SakonninBundle\Form\SakonninFileType', $file);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editF... | php | public function editAction(Request $request, SakonninFile $file, $access)
{
$deleteForm = $this->createDeleteForm($file);
$editForm = $this->createForm('BisonLab\SakonninBundle\Form\SakonninFileType', $file);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editF... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"SakonninFile",
"$",
"file",
",",
"$",
"access",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"file",
")",
";",
"$",
"editForm",
"=",
"$",
"t... | Displays a form to edit an existing file entity.
@Route("/{id}/edit", name="file_edit", methods={"GET", "POST"}) | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"file",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L171-L189 |
202,522 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.deleteAction | public function deleteAction(Request $request, SakonninFile $file, $access)
{
$form = $this->createDeleteForm($file);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrineManager();
$em->remove($file);
$e... | php | public function deleteAction(Request $request, SakonninFile $file, $access)
{
$form = $this->createDeleteForm($file);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrineManager();
$em->remove($file);
$e... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"SakonninFile",
"$",
"file",
",",
"$",
"access",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"file",
")",
";",
"$",
"form",
"->",
"handleRequest",... | Deletes a file entity.
@Route("/{id}", name="file_delete", methods={"DELETE"}) | [
"Deletes",
"a",
"file",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L196-L210 |
202,523 | thomasez/BisonLabSakonninBundle | Controller/SakonninFileController.php | SakonninFileController.createDeleteForm | public function createDeleteForm(SakonninFile $file)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('file_delete', array('id' => $file->getId())))
->setMethod('DELETE')
->getForm()
;
} | php | public function createDeleteForm(SakonninFile $file)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('file_delete', array('id' => $file->getId())))
->setMethod('DELETE')
->getForm()
;
} | [
"public",
"function",
"createDeleteForm",
"(",
"SakonninFile",
"$",
"file",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl",
"(",
"'file_delete'",
",",
"array",
"(",
"'id'",
"=>",... | Creates a form to delete a file entity.
@param SakonninFile $file The file entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"file",
"entity",
"."
] | 45ca7ce9874c4a2be7b503d7067b3d11d2b518cb | https://github.com/thomasez/BisonLabSakonninBundle/blob/45ca7ce9874c4a2be7b503d7067b3d11d2b518cb/Controller/SakonninFileController.php#L241-L248 |
202,524 | kaiohken1982/NeobazaarMailerModule | src/Mailer/Module.php | Module.onBootstrap | public function onBootstrap(EventInterface $e)
{
/* @var $application \Zend\Mvc\Application */
$application = $e->getTarget();
$serviceManager = $application->getServiceManager();
$eventManager = $application->getEventManager();
$eventManager->attachAggregate($serviceManager... | php | public function onBootstrap(EventInterface $e)
{
/* @var $application \Zend\Mvc\Application */
$application = $e->getTarget();
$serviceManager = $application->getServiceManager();
$eventManager = $application->getEventManager();
$eventManager->attachAggregate($serviceManager... | [
"public",
"function",
"onBootstrap",
"(",
"EventInterface",
"$",
"e",
")",
"{",
"/* @var $application \\Zend\\Mvc\\Application */",
"$",
"application",
"=",
"$",
"e",
"->",
"getTarget",
"(",
")",
";",
"$",
"serviceManager",
"=",
"$",
"application",
"->",
"getServi... | Registra delle azioni agli eventi che necesitano di invio email
Per quanto riguarda le risposte sarebbe da realizzare una nuova tabella che
salvi i messaggi inviati, la relativa entità, modello e servizio. | [
"Registra",
"delle",
"azioni",
"agli",
"eventi",
"che",
"necesitano",
"di",
"invio",
"email"
] | 0afc66196a0a392ecb4f052f483f2b5ff606bd8f | https://github.com/kaiohken1982/NeobazaarMailerModule/blob/0afc66196a0a392ecb4f052f483f2b5ff606bd8f/src/Mailer/Module.php#L25-L41 |
202,525 | 42Telecom/php-sdk-core | src/Factories/ServiceFactory.php | ServiceFactory.get | public static function get($type)
{
$instance = null;
switch ($type) {
case 'IM/Send':
$instance = new SendService();
break;
case 'IM/Status':
$instance = new StatusService();
break;
case 'TFA/Req... | php | public static function get($type)
{
$instance = null;
switch ($type) {
case 'IM/Send':
$instance = new SendService();
break;
case 'IM/Status':
$instance = new StatusService();
break;
case 'TFA/Req... | [
"public",
"static",
"function",
"get",
"(",
"$",
"type",
")",
"{",
"$",
"instance",
"=",
"null",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'IM/Send'",
":",
"$",
"instance",
"=",
"new",
"SendService",
"(",
")",
";",
"break",
";",
"case",
"... | Get instance of the specified service.
@param string $type type of service to call.
@return object Instance of the service. | [
"Get",
"instance",
"of",
"the",
"specified",
"service",
"."
] | 41d3cbebe01a93220318a250e08c50a6b69b1594 | https://github.com/42Telecom/php-sdk-core/blob/41d3cbebe01a93220318a250e08c50a6b69b1594/src/Factories/ServiceFactory.php#L22-L49 |
202,526 | linguisticteam/json-ld | src/Generators/json_ld.php | JSON_LD_Maker.make | public function make( $type )
{
$type = __NAMESPACE__ . "\\" . $type;
if (class_exists( $type )) {
/**
* @var \Lti\Seo\Generators\Thing $object
*/
$object = new $type( $this->helper );
$result = $object->format();
if (is_array... | php | public function make( $type )
{
$type = __NAMESPACE__ . "\\" . $type;
if (class_exists( $type )) {
/**
* @var \Lti\Seo\Generators\Thing $object
*/
$object = new $type( $this->helper );
$result = $object->format();
if (is_array... | [
"public",
"function",
"make",
"(",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"__NAMESPACE__",
".",
"\"\\\\\"",
".",
"$",
"type",
";",
"if",
"(",
"class_exists",
"(",
"$",
"type",
")",
")",
"{",
"/**\n * @var \\Lti\\Seo\\Generators\\Thing $object\n ... | Our schema.org object factory
Makes a new object provided it can find the class
@param string $type The type of object to create
@return null|string json encoded json-ld string, ready for output | [
"Our",
"schema",
".",
"org",
"object",
"factory"
] | 354fd518aff5fa52635f435888056fe0bd926566 | https://github.com/linguisticteam/json-ld/blob/354fd518aff5fa52635f435888056fe0bd926566/src/Generators/json_ld.php#L85-L100 |
202,527 | Xsaven/laravel-intelect-admin | src/Auth/Database/Permission.php | Permission.shouldPassThrough | public function shouldPassThrough(Request $request) : bool
{
if (empty($this->http_method) && empty($this->http_path)) {
return true;
}
$method = $this->http_method;
$matches = array_map(function ($path) use ($method) {
$path = trim(config('lia.route.prefix'... | php | public function shouldPassThrough(Request $request) : bool
{
if (empty($this->http_method) && empty($this->http_path)) {
return true;
}
$method = $this->http_method;
$matches = array_map(function ($path) use ($method) {
$path = trim(config('lia.route.prefix'... | [
"public",
"function",
"shouldPassThrough",
"(",
"Request",
"$",
"request",
")",
":",
"bool",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"http_method",
")",
"&&",
"empty",
"(",
"$",
"this",
"->",
"http_path",
")",
")",
"{",
"return",
"true",
";",
... | If request should pass through the current permission.
@param Request $request
@return bool | [
"If",
"request",
"should",
"pass",
"through",
"the",
"current",
"permission",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Auth/Database/Permission.php#L61-L87 |
202,528 | BenGorFile/DoctrineORMBridge | src/BenGorFile/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php | EntityManagerFactory.build | public function build($aConnection, $isDevMode = true)
{
Type::addType('file_id', FileIdType::class);
return EntityManager::create(
$aConnection,
Setup::createYAMLMetadataConfiguration([__DIR__ . '/Mapping'], $isDevMode)
);
} | php | public function build($aConnection, $isDevMode = true)
{
Type::addType('file_id', FileIdType::class);
return EntityManager::create(
$aConnection,
Setup::createYAMLMetadataConfiguration([__DIR__ . '/Mapping'], $isDevMode)
);
} | [
"public",
"function",
"build",
"(",
"$",
"aConnection",
",",
"$",
"isDevMode",
"=",
"true",
")",
"{",
"Type",
"::",
"addType",
"(",
"'file_id'",
",",
"FileIdType",
"::",
"class",
")",
";",
"return",
"EntityManager",
"::",
"create",
"(",
"$",
"aConnection",... | Decorates the doctrine entity manager
with library's mappings and custom types.
@param mixed $aConnection Connection parameters as db driver
@param bool $isDevMode Enables the dev mode, by default is enabled
@return EntityManager | [
"Decorates",
"the",
"doctrine",
"entity",
"manager",
"with",
"library",
"s",
"mappings",
"and",
"custom",
"types",
"."
] | c632521914d20c1bb7e837db7a3bcacbdebeeb7e | https://github.com/BenGorFile/DoctrineORMBridge/blob/c632521914d20c1bb7e837db7a3bcacbdebeeb7e/src/BenGorFile/DoctrineORMBridge/Infrastructure/Persistence/EntityManagerFactory.php#L36-L44 |
202,529 | miaoxing/plugin | src/Service/V.php | V.message | public function message($ruleOrMessage, $message = null)
{
if (1 === func_num_args()) {
$rule = $this->lastRule;
$message = $ruleOrMessage;
} else {
$rule = $ruleOrMessage;
}
$this->options['messages'][$this->lastKey][$rule] = $message;
r... | php | public function message($ruleOrMessage, $message = null)
{
if (1 === func_num_args()) {
$rule = $this->lastRule;
$message = $ruleOrMessage;
} else {
$rule = $ruleOrMessage;
}
$this->options['messages'][$this->lastKey][$rule] = $message;
r... | [
"public",
"function",
"message",
"(",
"$",
"ruleOrMessage",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"1",
"===",
"func_num_args",
"(",
")",
")",
"{",
"$",
"rule",
"=",
"$",
"this",
"->",
"lastRule",
";",
"$",
"message",
"=",
"$",
"rul... | Set rule message for current field
@param string $ruleOrMessage
@param string|null $message
@return $this | [
"Set",
"rule",
"message",
"for",
"current",
"field"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L247-L259 |
202,530 | miaoxing/plugin | src/Service/V.php | V.check | public function check($data = null)
{
$validator = $this->getValidator($data);
if ($validator->isValid()) {
return $this->suc();
} else {
return $this->err($validator->getFirstMessage());
}
} | php | public function check($data = null)
{
$validator = $this->getValidator($data);
if ($validator->isValid()) {
return $this->suc();
} else {
return $this->err($validator->getFirstMessage());
}
} | [
"public",
"function",
"check",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"validator",
"=",
"$",
"this",
"->",
"getValidator",
"(",
"$",
"data",
")",
";",
"if",
"(",
"$",
"validator",
"->",
"isValid",
"(",
")",
")",
"{",
"return",
"$",
"this",
... | Validate the data and return the ret array
@param mixed $data
@return array | [
"Validate",
"the",
"data",
"and",
"return",
"the",
"ret",
"array"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L289-L298 |
202,531 | miaoxing/plugin | src/Service/V.php | V.data | public function data($data)
{
if (!$data) {
return $this;
}
// Validate without key
if (!$this->lastKey) {
$data = ['' => $data];
}
$this->options['data'] = $data;
return $this;
} | php | public function data($data)
{
if (!$data) {
return $this;
}
// Validate without key
if (!$this->lastKey) {
$data = ['' => $data];
}
$this->options['data'] = $data;
return $this;
} | [
"public",
"function",
"data",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"data",
")",
"{",
"return",
"$",
"this",
";",
"}",
"// Validate without key",
"if",
"(",
"!",
"$",
"this",
"->",
"lastKey",
")",
"{",
"$",
"data",
"=",
"[",
"''",
"=>"... | Set data for validation
@param mixed $data
@return $this | [
"Set",
"data",
"for",
"validation"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L317-L331 |
202,532 | miaoxing/plugin | src/Service/V.php | V.getValidator | protected function getValidator($data = null)
{
if (!$this->validator) {
if ($data) {
// Validate without key
if ($this->lastKey === '') {
$data = ['' => $data];
}
$this->options['data'] = $data;
}
... | php | protected function getValidator($data = null)
{
if (!$this->validator) {
if ($data) {
// Validate without key
if ($this->lastKey === '') {
$data = ['' => $data];
}
$this->options['data'] = $data;
}
... | [
"protected",
"function",
"getValidator",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validator",
")",
"{",
"if",
"(",
"$",
"data",
")",
"{",
"// Validate without key",
"if",
"(",
"$",
"this",
"->",
"lastKey",
"===",
"... | Instance validate object
@param mixed $data
@return Validate | [
"Instance",
"validate",
"object"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L339-L355 |
202,533 | miaoxing/plugin | src/Service/V.php | V.addRule | public function addRule($name, $args)
{
$this->options['rules'][$this->lastKey][$name] = $args;
$this->lastRule = $name;
return $this;
} | php | public function addRule($name, $args)
{
$this->options['rules'][$this->lastKey][$name] = $args;
$this->lastRule = $name;
return $this;
} | [
"public",
"function",
"addRule",
"(",
"$",
"name",
",",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'rules'",
"]",
"[",
"$",
"this",
"->",
"lastKey",
"]",
"[",
"$",
"name",
"]",
"=",
"$",
"args",
";",
"$",
"this",
"->",
"lastRule",... | Add rule for current field
@param string $name
@param mixed $args
@return $this | [
"Add",
"rule",
"for",
"current",
"field"
] | f287a1e6c97abba6f06906255b8c26e8ab0afe61 | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/V.php#L364-L370 |
202,534 | danielgp/common-lib | source/MySQLiByDanielGPqueries.php | MySQLiByDanielGPqueries.getForeignKeysQuery | protected function getForeignKeysQuery($value)
{
$flt = [
'TABLE_SCHEMA' => $value['REFERENCED_TABLE_SCHEMA'],
'TABLE_NAME' => $value['REFERENCED_TABLE_NAME'],
'DATA_TYPE' => ['char', 'varchar', 'text'],
];
if (array_key_exists('LIMIT', $value)) {
... | php | protected function getForeignKeysQuery($value)
{
$flt = [
'TABLE_SCHEMA' => $value['REFERENCED_TABLE_SCHEMA'],
'TABLE_NAME' => $value['REFERENCED_TABLE_NAME'],
'DATA_TYPE' => ['char', 'varchar', 'text'],
];
if (array_key_exists('LIMIT', $value)) {
... | [
"protected",
"function",
"getForeignKeysQuery",
"(",
"$",
"value",
")",
"{",
"$",
"flt",
"=",
"[",
"'TABLE_SCHEMA'",
"=>",
"$",
"value",
"[",
"'REFERENCED_TABLE_SCHEMA'",
"]",
",",
"'TABLE_NAME'",
"=>",
"$",
"value",
"[",
"'REFERENCED_TABLE_NAME'",
"]",
",",
"... | prepares the query to detect FKs
@param array $value
@return string | [
"prepares",
"the",
"query",
"to",
"detect",
"FKs"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPqueries.php#L62-L73 |
202,535 | danielgp/common-lib | source/MySQLiByDanielGPqueries.php | MySQLiByDanielGPqueries.sManageDynamicFilters | private function sManageDynamicFilters($filterArray = null, $tableToApplyFilterTo = '')
{
if (is_null($filterArray)) {
return '';
}
$fltr = [];
unset($filterArray['LIMIT']);
foreach ($filterArray as $key => $value) {
$fltr[] = '`' . $tableToApplyFilter... | php | private function sManageDynamicFilters($filterArray = null, $tableToApplyFilterTo = '')
{
if (is_null($filterArray)) {
return '';
}
$fltr = [];
unset($filterArray['LIMIT']);
foreach ($filterArray as $key => $value) {
$fltr[] = '`' . $tableToApplyFilter... | [
"private",
"function",
"sManageDynamicFilters",
"(",
"$",
"filterArray",
"=",
"null",
",",
"$",
"tableToApplyFilterTo",
"=",
"''",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"filterArray",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"fltr",
"=",
"[",
... | Internal function to manage the filters passed to the query
@param null|array $filterArray
@param string $tableToApplyFilterTo
@return string | [
"Internal",
"function",
"to",
"manage",
"the",
"filters",
"passed",
"to",
"the",
"query"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPqueries.php#L124-L135 |
202,536 | danielgp/common-lib | source/MySQLiByDanielGPqueries.php | MySQLiByDanielGPqueries.setArrayLineArrayToFilter | private function setArrayLineArrayToFilter($key, $value, $referenceTable)
{
$filters2 = implode(', ', array_diff($value, ['']));
if ($filters2 != '') {
return '(' . $referenceTable . '`' . $key . '` IN ("'
. str_replace(',', '","', str_replace(["'", '"'], '', $filters2)) ... | php | private function setArrayLineArrayToFilter($key, $value, $referenceTable)
{
$filters2 = implode(', ', array_diff($value, ['']));
if ($filters2 != '') {
return '(' . $referenceTable . '`' . $key . '` IN ("'
. str_replace(',', '","', str_replace(["'", '"'], '', $filters2)) ... | [
"private",
"function",
"setArrayLineArrayToFilter",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"referenceTable",
")",
"{",
"$",
"filters2",
"=",
"implode",
"(",
"', '",
",",
"array_diff",
"(",
"$",
"value",
",",
"[",
"''",
"]",
")",
")",
";",
"if",
... | Builds an filter string from pair of key and value, where value is array
@param string $key
@param array $value
@param string $referenceTable
@return string | [
"Builds",
"an",
"filter",
"string",
"from",
"pair",
"of",
"key",
"and",
"value",
"where",
"value",
"is",
"array"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPqueries.php#L272-L280 |
202,537 | danielgp/common-lib | source/MySQLiByDanielGPqueries.php | MySQLiByDanielGPqueries.setArrayLineToFilter | private function setArrayLineToFilter($key, $value)
{
$fTemp = '=';
if ((substr($value, 0, 1) == '%') && (substr($value, -1) == '%')) {
$fTemp = 'LIKE';
}
return '(`' . $key . '` ' . $fTemp . '"' . $value . '")';
} | php | private function setArrayLineToFilter($key, $value)
{
$fTemp = '=';
if ((substr($value, 0, 1) == '%') && (substr($value, -1) == '%')) {
$fTemp = 'LIKE';
}
return '(`' . $key . '` ' . $fTemp . '"' . $value . '")';
} | [
"private",
"function",
"setArrayLineToFilter",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"fTemp",
"=",
"'='",
";",
"if",
"(",
"(",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"1",
")",
"==",
"'%'",
")",
"&&",
"(",
"substr",
"(",
"$",
"... | Builds an filter string from pair of key and value, none array
@param string $key
@param int|float|string $value
@return string | [
"Builds",
"an",
"filter",
"string",
"from",
"pair",
"of",
"key",
"and",
"value",
"none",
"array"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPqueries.php#L289-L296 |
202,538 | anime-db/catalog-bundle | src/Controller/PluginController.php | PluginController.installedAction | public function installedAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse('AnimeDbAppBundle:Plugin');
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
/* @var $rep EntityRep... | php | public function installedAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse('AnimeDbAppBundle:Plugin');
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
/* @var $rep EntityRep... | [
"public",
"function",
"installedAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
"'AnimeDbAppBundle:Plugin'",
")",
";",
"// response was not modified for this request"... | Installed plugins.
@param Request $request
@return Response | [
"Installed",
"plugins",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/PluginController.php#L38-L52 |
202,539 | anime-db/catalog-bundle | src/Controller/PluginController.php | PluginController.storeAction | public function storeAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse([], self::CACHE_LIFETIME);
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$plugins = [];
$dat... | php | public function storeAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse([], self::CACHE_LIFETIME);
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$plugins = [];
$dat... | [
"public",
"function",
"storeAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
"[",
"]",
",",
"self",
"::",
"CACHE_LIFETIME",
")",
";",
"// response was not mo... | Store of plugins.
@param Request $request
@return Response | [
"Store",
"of",
"plugins",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Controller/PluginController.php#L61-L86 |
202,540 | koolkode/context | src/Locator/BindingServiceLocator.php | BindingServiceLocator.getIterator | public function getIterator()
{
if($this->shared)
{
foreach($this->bindings as $key => $binding)
{
if(empty($this->bound[$key]))
{
$this->bound[$key] = $this->container->getBound($binding);
}
}
return new \ArrayIterator($this->bound);
}
$bound = [];
foreach($this->bindi... | php | public function getIterator()
{
if($this->shared)
{
foreach($this->bindings as $key => $binding)
{
if(empty($this->bound[$key]))
{
$this->bound[$key] = $this->container->getBound($binding);
}
}
return new \ArrayIterator($this->bound);
}
$bound = [];
foreach($this->bindi... | [
"public",
"function",
"getIterator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"shared",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"bindings",
"as",
"$",
"key",
"=>",
"$",
"binding",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"bo... | Provides an iterator on top of all registered services, obtaining the iterator triggers
loading of ALL registered services from the DI container.
@return \ArrayIterator<string, object> | [
"Provides",
"an",
"iterator",
"on",
"top",
"of",
"all",
"registered",
"services",
"obtaining",
"the",
"iterator",
"triggers",
"loading",
"of",
"ALL",
"registered",
"services",
"from",
"the",
"DI",
"container",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Locator/BindingServiceLocator.php#L87-L110 |
202,541 | koolkode/context | src/Locator/BindingServiceLocator.php | BindingServiceLocator.registerService | public function registerService(BindingInterface $binding, $name = NULL)
{
$key = ($name === NULL) ? $binding->getTypeName() : (string)$name;
if(isset($this->bindings[$key]))
{
throw new DuplicateServiceRegistrationException(sprintf('Service "%s" is already registered', $key));
}
$this->bindings[$ke... | php | public function registerService(BindingInterface $binding, $name = NULL)
{
$key = ($name === NULL) ? $binding->getTypeName() : (string)$name;
if(isset($this->bindings[$key]))
{
throw new DuplicateServiceRegistrationException(sprintf('Service "%s" is already registered', $key));
}
$this->bindings[$ke... | [
"public",
"function",
"registerService",
"(",
"BindingInterface",
"$",
"binding",
",",
"$",
"name",
"=",
"NULL",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"name",
"===",
"NULL",
")",
"?",
"$",
"binding",
"->",
"getTypeName",
"(",
")",
":",
"(",
"string",
... | Register a binding in the locator, will use the name of the bound type when no
name for the service is given.
@param BindingInterface $binding The binding being used to load the service.
@param string $name Optional name of the registered service.
@throws DuplicateServiceRegistrationException | [
"Register",
"a",
"binding",
"in",
"the",
"locator",
"will",
"use",
"the",
"name",
"of",
"the",
"bound",
"type",
"when",
"no",
"name",
"for",
"the",
"service",
"is",
"given",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Locator/BindingServiceLocator.php#L149-L159 |
202,542 | hamjoint/mustard-media | src/lib/Http/Controllers/MediaController.php | MediaController.getPhoto | public function getPhoto($photoId, $size = 'large')
{
$photo = Photo::findOrFail($photoId);
switch ($size) {
case 'large':
return response()->download(storage_path().'/app/'.$photo->pathLarge);
case 'small':
return response()->download(storage... | php | public function getPhoto($photoId, $size = 'large')
{
$photo = Photo::findOrFail($photoId);
switch ($size) {
case 'large':
return response()->download(storage_path().'/app/'.$photo->pathLarge);
case 'small':
return response()->download(storage... | [
"public",
"function",
"getPhoto",
"(",
"$",
"photoId",
",",
"$",
"size",
"=",
"'large'",
")",
"{",
"$",
"photo",
"=",
"Photo",
"::",
"findOrFail",
"(",
"$",
"photoId",
")",
";",
"switch",
"(",
"$",
"size",
")",
"{",
"case",
"'large'",
":",
"return",
... | Return a photo as a response.
@param int $photoId
@param string $size
@return \Illuminate\Http\Response | [
"Return",
"a",
"photo",
"as",
"a",
"response",
"."
] | d3c799dbc3578e1e1022bb4eccae7a20e285ba06 | https://github.com/hamjoint/mustard-media/blob/d3c799dbc3578e1e1022bb4eccae7a20e285ba06/src/lib/Http/Controllers/MediaController.php#L38-L50 |
202,543 | Horat1us/array-js-prototype | src/Collection.php | Collection.getLength | public function getLength()
{
if (!$this->container) {
return 0;
}
$count = count($this->container);
$keys = array_keys($this->container);
return (array_keys($this->container) === range(0, $count - 1))
? $count
: max($keys);
} | php | public function getLength()
{
if (!$this->container) {
return 0;
}
$count = count($this->container);
$keys = array_keys($this->container);
return (array_keys($this->container) === range(0, $count - 1))
? $count
: max($keys);
} | [
"public",
"function",
"getLength",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
")",
"{",
"return",
"0",
";",
"}",
"$",
"count",
"=",
"count",
"(",
"$",
"this",
"->",
"container",
")",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"... | Copying JS-like .length behavior
@return integer|string | [
"Copying",
"JS",
"-",
"like",
".",
"length",
"behavior"
] | 2dd6843eb221f81c2488237f164fdd392e98147a | https://github.com/Horat1us/array-js-prototype/blob/2dd6843eb221f81c2488237f164fdd392e98147a/src/Collection.php#L80-L91 |
202,544 | oyepez003/YepsuaRADBundle | Controller/CRUDController.php | CRUDController.crudShow | public function crudShow(Request $request, $id)
{
try{
$entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));
$form = $this->createDeleteForm($id)->createView();
return $this->commonsResponseVars(compact('entity','form'));
}catch(\... | php | public function crudShow(Request $request, $id)
{
try{
$entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));
$form = $this->createDeleteForm($id)->createView();
return $this->commonsResponseVars(compact('entity','form'));
}catch(\... | [
"public",
"function",
"crudShow",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"throwEntityNotFoundException",
"(",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"find",
"(",
"$",
"i... | Finds and displays an entity.
@param \Symfony\Component\HttpFoundation\Request $request
@param type $id
@return type | [
"Finds",
"and",
"displays",
"an",
"entity",
"."
] | 5e8c79f49201d5b2ba9487f16624a3f245941672 | https://github.com/oyepez003/YepsuaRADBundle/blob/5e8c79f49201d5b2ba9487f16624a3f245941672/Controller/CRUDController.php#L113-L124 |
202,545 | oyepez003/YepsuaRADBundle | Controller/CRUDController.php | CRUDController.crudUpdate | public function crudUpdate(Request $request, $id)
{
try{
$entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));
$form = $this->createForm($this->getEntityType(), $entity);
$form->submit($request);
$page = static::EDIT_V... | php | public function crudUpdate(Request $request, $id)
{
try{
$entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));
$form = $this->createForm($this->getEntityType(), $entity);
$form->submit($request);
$page = static::EDIT_V... | [
"public",
"function",
"crudUpdate",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"throwEntityNotFoundException",
"(",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"find",
"(",
"$",
... | Edits an existing entity.
@param \Symfony\Component\HttpFoundation\Request $request
@param type $id
@return type | [
"Edits",
"an",
"existing",
"entity",
"."
] | 5e8c79f49201d5b2ba9487f16624a3f245941672 | https://github.com/oyepez003/YepsuaRADBundle/blob/5e8c79f49201d5b2ba9487f16624a3f245941672/Controller/CRUDController.php#L154-L178 |
202,546 | libreworks/caridea-dao | src/Exception/Translator/MongoDb.php | MongoDb.translate | public static function translate(\Exception $e): \Exception
{
if ($e instanceof \MongoDB\Driver\Exception\ConnectionException ||
$e instanceof \MongoDB\Driver\Exception\ExecutionTimeoutException) {
return new \Caridea\Dao\Exception\Unreachable("System unreachable or connection ti... | php | public static function translate(\Exception $e): \Exception
{
if ($e instanceof \MongoDB\Driver\Exception\ConnectionException ||
$e instanceof \MongoDB\Driver\Exception\ExecutionTimeoutException) {
return new \Caridea\Dao\Exception\Unreachable("System unreachable or connection ti... | [
"public",
"static",
"function",
"translate",
"(",
"\\",
"Exception",
"$",
"e",
")",
":",
"\\",
"Exception",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"\\",
"MongoDB",
"\\",
"Driver",
"\\",
"Exception",
"\\",
"ConnectionException",
"||",
"$",
"e",
"instanceof... | Translates a MongoDB exception.
@param \Exception $e The exception to translate
@return \Exception The exception to use | [
"Translates",
"a",
"MongoDB",
"exception",
"."
] | 22c2fc81f63050ad23f7b0c40e430ff026e1e767 | https://github.com/libreworks/caridea-dao/blob/22c2fc81f63050ad23f7b0c40e430ff026e1e767/src/Exception/Translator/MongoDb.php#L37-L57 |
202,547 | mtils/cmsable | src/Cmsable/Translation/Translator.php | Translator.overwrite | public function overwrite($key, $message=null)
{
if (!is_array($key)) {
$this->overwrites[$key] = $message;
return $this;
}
foreach ($key as $k=>$v) {
$this->overwrite($k, $v);
}
return $this;
} | php | public function overwrite($key, $message=null)
{
if (!is_array($key)) {
$this->overwrites[$key] = $message;
return $this;
}
foreach ($key as $k=>$v) {
$this->overwrite($k, $v);
}
return $this;
} | [
"public",
"function",
"overwrite",
"(",
"$",
"key",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"overwrites",
"[",
"$",
"key",
"]",
"=",
"$",
"message",
";",
"return",... | Overwrite one or more lang keys
@param string|array $key
@param mixed $message (optional)
@return self | [
"Overwrite",
"one",
"or",
"more",
"lang",
"keys"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Translation/Translator.php#L69-L81 |
202,548 | yuncms/yii2-article | frontend/controllers/ArticleController.php | ArticleController.findModelByUUID | protected function findModelByUUID($uuid)
{
if (($model = Article::findOne(['uuid' => $uuid])) != null) {
return $model;
}
throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist'));
} | php | protected function findModelByUUID($uuid)
{
if (($model = Article::findOne(['uuid' => $uuid])) != null) {
return $model;
}
throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist'));
} | [
"protected",
"function",
"findModelByUUID",
"(",
"$",
"uuid",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"Article",
"::",
"findOne",
"(",
"[",
"'uuid'",
"=>",
"$",
"uuid",
"]",
")",
")",
"!=",
"null",
")",
"{",
"return",
"$",
"model",
";",
"}",
... | Finds the Article model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param string $uuid
@return Article the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Article",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | 177ec4d3d143b2f2a69bce760e873485cf3df192 | https://github.com/yuncms/yii2-article/blob/177ec4d3d143b2f2a69bce760e873485cf3df192/frontend/controllers/ArticleController.php#L240-L246 |
202,549 | nicodevs/laito | src/Laito/Session/Tokens/FileTokens.php | FileTokens.get | public function get($hash = null)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Determine token path
$path = $this->path($hash);
// Abort if the session does not exist
if (!file_exists($path)) {
... | php | public function get($hash = null)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Determine token path
$path = $this->path($hash);
// Abort if the session does not exist
if (!file_exists($path)) {
... | [
"public",
"function",
"get",
"(",
"$",
"hash",
"=",
"null",
")",
"{",
"// If the hash is not received, get it from the request",
"$",
"hash",
"=",
"$",
"hash",
"?",
":",
"$",
"this",
"->",
"app",
"->",
"request",
"->",
"token",
"(",
")",
";",
"// Determine t... | Gets the token data
@param string $hash Token hash
@return array|bool Token data or false | [
"Gets",
"the",
"token",
"data"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Tokens/FileTokens.php#L32-L53 |
202,550 | nicodevs/laito | src/Laito/Session/Tokens/FileTokens.php | FileTokens.create | public function create($data = [])
{
// Create a random hash
$hash = $this->hash();
// Store the file in the tokens storage
$data = array_merge($data, ['token' => $hash, 'timestamp' => time()]);
$stored = file_put_contents($this->path($hash), json_encode($data));
//... | php | public function create($data = [])
{
// Create a random hash
$hash = $this->hash();
// Store the file in the tokens storage
$data = array_merge($data, ['token' => $hash, 'timestamp' => time()]);
$stored = file_put_contents($this->path($hash), json_encode($data));
//... | [
"public",
"function",
"create",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"// Create a random hash",
"$",
"hash",
"=",
"$",
"this",
"->",
"hash",
"(",
")",
";",
"// Store the file in the tokens storage",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
... | Creates a token
@param array $data Data to store
@return Token data | [
"Creates",
"a",
"token"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Tokens/FileTokens.php#L61-L72 |
202,551 | nicodevs/laito | src/Laito/Session/Tokens/FileTokens.php | FileTokens.update | public function update($hash = null, $data)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Update the file in the tokens storage
$token = $this->get($hash);
$data = array_merge_recursive($token, $data);
$sto... | php | public function update($hash = null, $data)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Update the file in the tokens storage
$token = $this->get($hash);
$data = array_merge_recursive($token, $data);
$sto... | [
"public",
"function",
"update",
"(",
"$",
"hash",
"=",
"null",
",",
"$",
"data",
")",
"{",
"// If the hash is not received, get it from the request",
"$",
"hash",
"=",
"$",
"hash",
"?",
":",
"$",
"this",
"->",
"app",
"->",
"request",
"->",
"token",
"(",
")... | Updates a token
@param string $hash Token hash
@param array $data Data to store
@return Token data | [
"Updates",
"a",
"token"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Tokens/FileTokens.php#L81-L93 |
202,552 | nicodevs/laito | src/Laito/Session/Tokens/FileTokens.php | FileTokens.destroy | public function destroy($hash = null)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Abort if the file does not exist
$path = $this->path($hash);
if (!file_exists($path)) {
return true;
}
... | php | public function destroy($hash = null)
{
// If the hash is not received, get it from the request
$hash = $hash?: $this->app->request->token();
// Abort if the file does not exist
$path = $this->path($hash);
if (!file_exists($path)) {
return true;
}
... | [
"public",
"function",
"destroy",
"(",
"$",
"hash",
"=",
"null",
")",
"{",
"// If the hash is not received, get it from the request",
"$",
"hash",
"=",
"$",
"hash",
"?",
":",
"$",
"this",
"->",
"app",
"->",
"request",
"->",
"token",
"(",
")",
";",
"// Abort i... | Destroys a token
@param string $hash Token hash
@return bool Success or failure | [
"Destroys",
"a",
"token"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Session/Tokens/FileTokens.php#L101-L120 |
202,553 | TuumPHP/Web | src/Stack/Dispatcher.php | Dispatcher.prepare | private function prepare($route)
{
$this->route = $route;
$this->setBeforeFilter($route->before());
$this->setAfterRelease($route->after());
} | php | private function prepare($route)
{
$this->route = $route;
$this->setBeforeFilter($route->before());
$this->setAfterRelease($route->after());
} | [
"private",
"function",
"prepare",
"(",
"$",
"route",
")",
"{",
"$",
"this",
"->",
"route",
"=",
"$",
"route",
";",
"$",
"this",
"->",
"setBeforeFilter",
"(",
"$",
"route",
"->",
"before",
"(",
")",
")",
";",
"$",
"this",
"->",
"setAfterRelease",
"(",... | prepares before filters and after releases from route.
@param Route $route | [
"prepares",
"before",
"filters",
"and",
"after",
"releases",
"from",
"route",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Stack/Dispatcher.php#L78-L83 |
202,554 | translationexchange/tml-php-clientsdk | library/Tr8n/LanguageContext.php | LanguageContext.fallbackRule | function fallbackRule() {
if (!isset($this->fallback_rule)) {
foreach($this->rules as $key => $rule) {
if ($rule->isFallback()) {
$this->fallback_rule = $rule;
}
}
}
return $this->fallback_rule;
} | php | function fallbackRule() {
if (!isset($this->fallback_rule)) {
foreach($this->rules as $key => $rule) {
if ($rule->isFallback()) {
$this->fallback_rule = $rule;
}
}
}
return $this->fallback_rule;
} | [
"function",
"fallbackRule",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fallback_rule",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"key",
"=>",
"$",
"rule",
")",
"{",
"if",
"(",
"$",
"rule",
"->",
... | Fallback rule usually has a key of "other", but that may not be necessary in all cases.
@return mixed | [
"Fallback",
"rule",
"usually",
"has",
"a",
"key",
"of",
"other",
"but",
"that",
"may",
"not",
"be",
"necessary",
"in",
"all",
"cases",
"."
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/LanguageContext.php#L119-L129 |
202,555 | sokil/CommandBusBundle | src/CommandBus/CommandHandlerServiceResolver.php | CommandHandlerServiceResolver.get | public function get($handlerServiceId)
{
$handler = $this->container->get($handlerServiceId);
if (!$handler instanceof CommandHandlerInterface) {
throw new \InvalidArgumentException('Handler must be instance if ' . CommandHandlerInterface::class);
}
return $handler;
... | php | public function get($handlerServiceId)
{
$handler = $this->container->get($handlerServiceId);
if (!$handler instanceof CommandHandlerInterface) {
throw new \InvalidArgumentException('Handler must be instance if ' . CommandHandlerInterface::class);
}
return $handler;
... | [
"public",
"function",
"get",
"(",
"$",
"handlerServiceId",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"handlerServiceId",
")",
";",
"if",
"(",
"!",
"$",
"handler",
"instanceof",
"CommandHandlerInterface",
")",
"{"... | Get command handler
@param string $handlerServiceId
@return CommandHandlerInterface | [
"Get",
"command",
"handler"
] | 7cfdd5f1e8a77f0620b94dd5214091a2159a143d | https://github.com/sokil/CommandBusBundle/blob/7cfdd5f1e8a77f0620b94dd5214091a2159a143d/src/CommandBus/CommandHandlerServiceResolver.php#L30-L39 |
202,556 | eureka-framework/component-cache | src/Cache/CacheFactory.php | CacheFactory.engine | protected static function engine()
{
$engine = '';
foreach (static::$engines as $name => $function) {
if ($function === null || function_exists($function)) {
$engine = $name;
break;
}
}
return $engine;
} | php | protected static function engine()
{
$engine = '';
foreach (static::$engines as $name => $function) {
if ($function === null || function_exists($function)) {
$engine = $name;
break;
}
}
return $engine;
} | [
"protected",
"static",
"function",
"engine",
"(",
")",
"{",
"$",
"engine",
"=",
"''",
";",
"foreach",
"(",
"static",
"::",
"$",
"engines",
"as",
"$",
"name",
"=>",
"$",
"function",
")",
"{",
"if",
"(",
"$",
"function",
"===",
"null",
"||",
"function_... | Get name of php Cache engine used.
@return string engine | [
"Get",
"name",
"of",
"php",
"Cache",
"engine",
"used",
"."
] | c110441ac7bb20edd2ecd8162f4302596d875785 | https://github.com/eureka-framework/component-cache/blob/c110441ac7bb20edd2ecd8162f4302596d875785/src/Cache/CacheFactory.php#L36-L48 |
202,557 | eureka-framework/component-cache | src/Cache/CacheFactory.php | CacheFactory.build | public static function build($engine = null, $namespace = '\Eureka\Component\Cache')
{
if (null === $engine) {
$engine = static::engine();
}
if (empty(static::$instances[$engine])) {
$class = $namespace . '\\' . 'CacheWrapper' . $engine;
s... | php | public static function build($engine = null, $namespace = '\Eureka\Component\Cache')
{
if (null === $engine) {
$engine = static::engine();
}
if (empty(static::$instances[$engine])) {
$class = $namespace . '\\' . 'CacheWrapper' . $engine;
s... | [
"public",
"static",
"function",
"build",
"(",
"$",
"engine",
"=",
"null",
",",
"$",
"namespace",
"=",
"'\\Eureka\\Component\\Cache'",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"engine",
")",
"{",
"$",
"engine",
"=",
"static",
"::",
"engine",
"(",
")",
"... | Instantiate Cache Wrapper object & return it.
@param string $engine Class name of the engine to use.
@param string $namespace
@return CacheWrapperAbstract | [
"Instantiate",
"Cache",
"Wrapper",
"object",
"&",
"return",
"it",
"."
] | c110441ac7bb20edd2ecd8162f4302596d875785 | https://github.com/eureka-framework/component-cache/blob/c110441ac7bb20edd2ecd8162f4302596d875785/src/Cache/CacheFactory.php#L58-L70 |
202,558 | Kris-Kuiper/sFire-Framework | src/Translation/Translation.php | Translation.translate | public static function translate($key, $params = [], $language = null, Viewmodel $viewmodel = null) {
$identifier = null;
if(null !== $viewmodel) {
$identifier = static :: load($viewmodel);
}
if(null === $key) {
$key = '';
}
//Check if key is a string
if(false === is_string($key))... | php | public static function translate($key, $params = [], $language = null, Viewmodel $viewmodel = null) {
$identifier = null;
if(null !== $viewmodel) {
$identifier = static :: load($viewmodel);
}
if(null === $key) {
$key = '';
}
//Check if key is a string
if(false === is_string($key))... | [
"public",
"static",
"function",
"translate",
"(",
"$",
"key",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"language",
"=",
"null",
",",
"Viewmodel",
"$",
"viewmodel",
"=",
"null",
")",
"{",
"$",
"identifier",
"=",
"null",
";",
"if",
"(",
"null",
"... | Translate text based on a key
@param string $key
@param array $params
@param string $language
@param sFire\MVC\Viewmodel $viewmodel
@return string | [
"Translate",
"text",
"based",
"on",
"a",
"key"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Translation/Translation.php#L41-L94 |
202,559 | Kris-Kuiper/sFire-Framework | src/Translation/Translation.php | Translation.load | public static function load($source) {
if(false === is_string($source) && false === $source instanceof Viewmodel) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or instance of sFire\MVC\Viewmodel, "%s" given', __METHOD__, gettype($source)), E_USER_ERROR);
}
$file =... | php | public static function load($source) {
if(false === is_string($source) && false === $source instanceof Viewmodel) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or instance of sFire\MVC\Viewmodel, "%s" given', __METHOD__, gettype($source)), E_USER_ERROR);
}
$file =... | [
"public",
"static",
"function",
"load",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"source",
")",
"&&",
"false",
"===",
"$",
"source",
"instanceof",
"Viewmodel",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(... | Loads a new translation file
@param string|sFire\MVC\Viewmodel $source
@return string | [
"Loads",
"a",
"new",
"translation",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Translation/Translation.php#L102-L135 |
202,560 | Kris-Kuiper/sFire-Framework | src/Translation/Translation.php | Translation.cache | private static function cache(File $cache, File $file) {
if(false === isset(static :: $translations[$cache -> entity() -> getName()])) {
$parse = true;
if(true === $cache -> exists()) {
if($cache -> entity() -> getModificationTime() >= $file -> entity() -> getModificationTime()) {
$par... | php | private static function cache(File $cache, File $file) {
if(false === isset(static :: $translations[$cache -> entity() -> getName()])) {
$parse = true;
if(true === $cache -> exists()) {
if($cache -> entity() -> getModificationTime() >= $file -> entity() -> getModificationTime()) {
$par... | [
"private",
"static",
"function",
"cache",
"(",
"File",
"$",
"cache",
",",
"File",
"$",
"file",
")",
"{",
"if",
"(",
"false",
"===",
"isset",
"(",
"static",
"::",
"$",
"translations",
"[",
"$",
"cache",
"->",
"entity",
"(",
")",
"->",
"getName",
"(",
... | Returns cache if exists, otherwise the translation cache file is created, filled with content and returned
@param sFire\System\File $cache
@param sFire\System\File $file | [
"Returns",
"cache",
"if",
"exists",
"otherwise",
"the",
"translation",
"cache",
"file",
"is",
"created",
"filled",
"with",
"content",
"and",
"returned"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Translation/Translation.php#L166-L188 |
202,561 | Kris-Kuiper/sFire-Framework | src/Translation/Translation.php | Translation.parse | private static function parse(File $file) {
$lines = explode("\n", $file -> getContent());
$languages = [];
foreach($lines as $index => $line) {
$line = trim($line);
if('' === $line) {
continue;
}
//Check for language format
preg_match('#^\[([a-z_\-0-9]+)\]#i', $line, $... | php | private static function parse(File $file) {
$lines = explode("\n", $file -> getContent());
$languages = [];
foreach($lines as $index => $line) {
$line = trim($line);
if('' === $line) {
continue;
}
//Check for language format
preg_match('#^\[([a-z_\-0-9]+)\]#i', $line, $... | [
"private",
"static",
"function",
"parse",
"(",
"File",
"$",
"file",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"file",
"->",
"getContent",
"(",
")",
")",
";",
"$",
"languages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"lines"... | Parses a translation file and converts it into an array
@param sFire\System\File $file
@return array | [
"Parses",
"a",
"translation",
"file",
"and",
"converts",
"it",
"into",
"an",
"array"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Translation/Translation.php#L196-L236 |
202,562 | itkg/core | src/Itkg/Core/Command/DatabaseUpdate/ReleaseChecker.php | ReleaseChecker.check | public function check(array $scripts, array $rollbacks)
{
$this->checkScripts($scripts, $rollbacks);
foreach ($scripts as $k => $script) {
$this->checkScript($script, $rollbacks[$k]);
}
} | php | public function check(array $scripts, array $rollbacks)
{
$this->checkScripts($scripts, $rollbacks);
foreach ($scripts as $k => $script) {
$this->checkScript($script, $rollbacks[$k]);
}
} | [
"public",
"function",
"check",
"(",
"array",
"$",
"scripts",
",",
"array",
"$",
"rollbacks",
")",
"{",
"$",
"this",
"->",
"checkScripts",
"(",
"$",
"scripts",
",",
"$",
"rollbacks",
")",
";",
"foreach",
"(",
"$",
"scripts",
"as",
"$",
"k",
"=>",
"$",... | Check a release scripts & rollbacks
and each script separately
@param array $scripts
@param array $rollbacks
@throws \RuntimeException
@throws \LogicException
@throws \InvalidArgumentException | [
"Check",
"a",
"release",
"scripts",
"&",
"rollbacks",
"and",
"each",
"script",
"separately"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Command/DatabaseUpdate/ReleaseChecker.php#L35-L43 |
202,563 | bandama-framework/bandama-framework | src/Configuration.php | Configuration.get | public function get($key) {
if (isset($this->settings[$key])) {
return $this->settings[$key];
}
return null;
} | php | public function get($key) {
if (isset($this->settings[$key])) {
return $this->settings[$key];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"settings",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"settings",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"null",
";",... | Get configuration parameter by key if exists else return null
@return mixed | [
"Get",
"configuration",
"parameter",
"by",
"key",
"if",
"exists",
"else",
"return",
"null"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/Configuration.php#L54-L60 |
202,564 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.cmdGetFieldValue | public function cmdGetFieldValue()
{
$result = $this->getListFieldValue();
$this->outputFormat($result);
$this->outputFormatTableFieldValue($result);
$this->output();
} | php | public function cmdGetFieldValue()
{
$result = $this->getListFieldValue();
$this->outputFormat($result);
$this->outputFormatTableFieldValue($result);
$this->output();
} | [
"public",
"function",
"cmdGetFieldValue",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListFieldValue",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableFieldValue",
"(",
"$",... | Callback for "field-value-get" command | [
"Callback",
"for",
"field",
"-",
"value",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L40-L46 |
202,565 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.cmdDeleteFieldValue | public function cmdDeleteFieldValue()
{
$id = $this->getParam(0);
if (empty($id) || !is_numeric($id)) {
$this->errorAndExit($this->text('Invalid command'));
}
if ($this->getParam('field')) {
$deleted = $count = 0;
foreach ($this->field_value->get... | php | public function cmdDeleteFieldValue()
{
$id = $this->getParam(0);
if (empty($id) || !is_numeric($id)) {
$this->errorAndExit($this->text('Invalid command'));
}
if ($this->getParam('field')) {
$deleted = $count = 0;
foreach ($this->field_value->get... | [
"public",
"function",
"cmdDeleteFieldValue",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"... | Callback for "field-value-delete" command | [
"Callback",
"for",
"field",
"-",
"value",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L51-L77 |
202,566 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.cmdUpdateFieldValue | public function cmdUpdateFieldValue()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateFieldValue()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateFieldValue",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
... | Callback for "field-value-update" command | [
"Callback",
"for",
"field",
"-",
"value",
"-",
"update",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L96-L114 |
202,567 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.getListFieldValue | protected function getListFieldValue()
{
$id = $this->getParam(0);
if (!isset($id)) {
return $this->field_value->getList(array('limit' => $this->getLimit()));
}
if ($this->getParam('field')) {
return $this->field_value->getList(array('field_id' => $id, 'limi... | php | protected function getListFieldValue()
{
$id = $this->getParam(0);
if (!isset($id)) {
return $this->field_value->getList(array('limit' => $this->getLimit()));
}
if ($this->getParam('field')) {
return $this->field_value->getList(array('field_id' => $id, 'limi... | [
"protected",
"function",
"getListFieldValue",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"field_value",
"->",
"getList",
"("... | Returns an array of field values
@return array | [
"Returns",
"an",
"array",
"of",
"field",
"values"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L120-L143 |
202,568 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.addFieldValue | protected function addFieldValue()
{
if (!$this->isError()) {
$id = $this->field_value->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | php | protected function addFieldValue()
{
if (!$this->isError()) {
$id = $this->field_value->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | [
"protected",
"function",
"addFieldValue",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isError",
"(",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"field_value",
"->",
"add",
"(",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
")",
";",
... | Add a new field value | [
"Add",
"a",
"new",
"field",
"value"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L177-L186 |
202,569 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.submitAddFieldValue | protected function submitAddFieldValue()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('field_value');
$this->addFieldValue();
} | php | protected function submitAddFieldValue()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('field_value');
$this->addFieldValue();
} | [
"protected",
"function",
"submitAddFieldValue",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"validateComponent",
"(",
"'field_value'",
")",
";",
"$",
"this",
"-... | Add a new field value at once | [
"Add",
"a",
"new",
"field",
"value",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L202-L207 |
202,570 | gplcart/cli | controllers/commands/FieldValue.php | FieldValue.wizardAddFieldValue | protected function wizardAddFieldValue()
{
// Required
$this->validatePrompt('title', $this->text('Title'), 'field_value');
$this->validatePrompt('field_id', $this->text('Field ID'), 'field_value');
// Optional
$this->validatePrompt('color', $this->text('Color'), 'field_valu... | php | protected function wizardAddFieldValue()
{
// Required
$this->validatePrompt('title', $this->text('Title'), 'field_value');
$this->validatePrompt('field_id', $this->text('Field ID'), 'field_value');
// Optional
$this->validatePrompt('color', $this->text('Color'), 'field_valu... | [
"protected",
"function",
"wizardAddFieldValue",
"(",
")",
"{",
"// Required",
"$",
"this",
"->",
"validatePrompt",
"(",
"'title'",
",",
"$",
"this",
"->",
"text",
"(",
"'Title'",
")",
",",
"'field_value'",
")",
";",
"$",
"this",
"->",
"validatePrompt",
"(",
... | Add a new field value step by step | [
"Add",
"a",
"new",
"field",
"value",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/FieldValue.php#L212-L224 |
202,571 | Dhii/stringable-helper-base | src/StringableJoinCapableTrait.php | StringableJoinCapableTrait._stringableJoin | protected function _stringableJoin($parts, $delim)
{
$parts = $this->_normalizeIterable($parts);
$i = 0;
$result = '';
foreach ($parts as $_part) {
try {
$_part = $this->_normalizeString($_part);
} catch (InvalidArgumentException $e) {
... | php | protected function _stringableJoin($parts, $delim)
{
$parts = $this->_normalizeIterable($parts);
$i = 0;
$result = '';
foreach ($parts as $_part) {
try {
$_part = $this->_normalizeString($_part);
} catch (InvalidArgumentException $e) {
... | [
"protected",
"function",
"_stringableJoin",
"(",
"$",
"parts",
",",
"$",
"delim",
")",
"{",
"$",
"parts",
"=",
"$",
"this",
"->",
"_normalizeIterable",
"(",
"$",
"parts",
")",
";",
"$",
"i",
"=",
"0",
";",
"$",
"result",
"=",
"''",
";",
"foreach",
... | Joins a list of parts using a delimiter.
@param array|stdClass|Traversable $parts The list of parts to join.
@param string|Stringable $delim The delimiter to use for joining.
@throws InvalidArgumentException If the list of parts or the delimiter is invalid.
@throws OutOfRangeException If one of the part... | [
"Joins",
"a",
"list",
"of",
"parts",
"using",
"a",
"delimiter",
"."
] | 904254409800710665135a751659b59d140a2b40 | https://github.com/Dhii/stringable-helper-base/blob/904254409800710665135a751659b59d140a2b40/src/StringableJoinCapableTrait.php#L30-L51 |
202,572 | Subscribo/dependencyresolver | src/Subscribo/DependencyResolver/DependencyResolver.php | DependencyResolver.reorder | public static function reorder(array $data, array $order, $throwExceptionIfKeyNotFound = false, $throwExceptionIfExtraData = false) {
$result = array();
foreach($order as $orderedKey) {
if (array_key_exists($orderedKey, $data)) {
$result[$orderedKey] = $data[$orderedKey];
... | php | public static function reorder(array $data, array $order, $throwExceptionIfKeyNotFound = false, $throwExceptionIfExtraData = false) {
$result = array();
foreach($order as $orderedKey) {
if (array_key_exists($orderedKey, $data)) {
$result[$orderedKey] = $data[$orderedKey];
... | [
"public",
"static",
"function",
"reorder",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"order",
",",
"$",
"throwExceptionIfKeyNotFound",
"=",
"false",
",",
"$",
"throwExceptionIfExtraData",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
"... | Orders data based on order of values in order array
@param array $data
@param array $order
@param bool $throwExceptionIfKeyNotFound
@param bool $throwExceptionIfExtraData
@return array
@throws \Subscribo\DependencyResolver\KeyNotFoundException may be thrown, if key is not found in data
@throws \Subscribo\DependencyRes... | [
"Orders",
"data",
"based",
"on",
"order",
"of",
"values",
"in",
"order",
"array"
] | c345569ca497b6d7e2ade4a93eb19bb535b8b857 | https://github.com/Subscribo/dependencyresolver/blob/c345569ca497b6d7e2ade4a93eb19bb535b8b857/src/Subscribo/DependencyResolver/DependencyResolver.php#L89-L109 |
202,573 | rawphp/RawBase | lib/Model.php | Model.init | public function init( $config = NULL )
{
parent::init( $config );
if ( isset( $config[ 'id' ] ) )
{
$this->id = ( int )$config[ 'id' ];
}
$this->doAction( self::ON_MODEL_INIT_ACTION );
} | php | public function init( $config = NULL )
{
parent::init( $config );
if ( isset( $config[ 'id' ] ) )
{
$this->id = ( int )$config[ 'id' ];
}
$this->doAction( self::ON_MODEL_INIT_ACTION );
} | [
"public",
"function",
"init",
"(",
"$",
"config",
"=",
"NULL",
")",
"{",
"parent",
"::",
"init",
"(",
"$",
"config",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"(",
"int",
... | Initialises the model.
@param array $config configuration array
@action ON_MODEL_INIT_ACTION | [
"Initialises",
"the",
"model",
"."
] | 509843f6338bbd8323b685d0ed5e80717a54c2ff | https://github.com/rawphp/RawBase/blob/509843f6338bbd8323b685d0ed5e80717a54c2ff/lib/Model.php#L61-L71 |
202,574 | prolic/HumusMvc | src/HumusMvc/Navigation/Service/NavigationFactory.php | NavigationFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
$navigationConfig = $config['navigation'];
$navigation = new Navigation($navigationConfig);
return $navigation;
} | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$config = $serviceLocator->get('Config');
$navigationConfig = $config['navigation'];
$navigation = new Navigation($navigationConfig);
return $navigation;
} | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Config'",
")",
";",
"$",
"navigationConfig",
"=",
"$",
"config",
"[",
"'navigation'",
"]",
";... | Create navigation service
@param ServiceLocatorInterface $serviceLocator
@return Navigation | [
"Create",
"navigation",
"service"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/Navigation/Service/NavigationFactory.php#L38-L44 |
202,575 | eureka-framework/component-orm | src/Orm/Column.php | Column.getProperty | public function getProperty()
{
return '
/**
* @var ' . $this->getType()->getType() . ' $' . $this->getPropertyName() . '
*/
protected $' . $this->getPropertyName() . ' = ' . $this->getDefault(true) . ';';
} | php | public function getProperty()
{
return '
/**
* @var ' . $this->getType()->getType() . ' $' . $this->getPropertyName() . '
*/
protected $' . $this->getPropertyName() . ' = ' . $this->getDefault(true) . ';';
} | [
"public",
"function",
"getProperty",
"(",
")",
"{",
"return",
"'\n /**\n * @var '",
".",
"$",
"this",
"->",
"getType",
"(",
")",
"->",
"getType",
"(",
")",
".",
"' $'",
".",
"$",
"this",
"->",
"getPropertyName",
"(",
")",
".",
"'\n */\n protect... | Get property declaration.
@return string | [
"Get",
"property",
"declaration",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L78-L85 |
202,576 | eureka-framework/component-orm | src/Orm/Column.php | Column.getGetter | public function getGetter()
{
return '
/**
* Get value for field "' . $this->getName() . '"
*
* @return ' . $this->getType()->getType() . '
*/
public function ' . $this->getMethodNameGet() . '()
{
return $this->' . $this->getPropertyName() . ';
}';
} | php | public function getGetter()
{
return '
/**
* Get value for field "' . $this->getName() . '"
*
* @return ' . $this->getType()->getType() . '
*/
public function ' . $this->getMethodNameGet() . '()
{
return $this->' . $this->getPropertyName() . ';
}';
} | [
"public",
"function",
"getGetter",
"(",
")",
"{",
"return",
"'\n /**\n * Get value for field \"'",
".",
"$",
"this",
"->",
"getName",
"(",
")",
".",
"'\"\n *\n * @return '",
".",
"$",
"this",
"->",
"getType",
"(",
")",
"->",
"getType",
"(",
")",
... | Get method getter.
@return string | [
"Get",
"method",
"getter",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L92-L104 |
202,577 | eureka-framework/component-orm | src/Orm/Column.php | Column.getSetter | public function getSetter()
{
$varname = '$' . $this->getPropertyName();
$autoinc = '';
$cast = $this->getType()->getCastMethod() . ' ';
if ($this->isNullable()) {
$forceCast = $varname . ' = (' . $varname . ' === null ? ' . $varname . ' : ' . $cast . $varname . ');';... | php | public function getSetter()
{
$varname = '$' . $this->getPropertyName();
$autoinc = '';
$cast = $this->getType()->getCastMethod() . ' ';
if ($this->isNullable()) {
$forceCast = $varname . ' = (' . $varname . ' === null ? ' . $varname . ' : ' . $cast . $varname . ');';... | [
"public",
"function",
"getSetter",
"(",
")",
"{",
"$",
"varname",
"=",
"'$'",
".",
"$",
"this",
"->",
"getPropertyName",
"(",
")",
";",
"$",
"autoinc",
"=",
"''",
";",
"$",
"cast",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
"->",
"getCastMethod",
... | Get method setter.
@return string | [
"Get",
"method",
"setter",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L111-L159 |
202,578 | eureka-framework/component-orm | src/Orm/Column.php | Column.getName | public function getName($withoutPrefix = false)
{
$name = $this->name;
if ($withoutPrefix && stripos($name, $this->dbPrefix) === 0) {
$name = substr($name, strlen($this->dbPrefix));
}
return $name;
} | php | public function getName($withoutPrefix = false)
{
$name = $this->name;
if ($withoutPrefix && stripos($name, $this->dbPrefix) === 0) {
$name = substr($name, strlen($this->dbPrefix));
}
return $name;
} | [
"public",
"function",
"getName",
"(",
"$",
"withoutPrefix",
"=",
"false",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"name",
";",
"if",
"(",
"$",
"withoutPrefix",
"&&",
"stripos",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"dbPrefix",
")",
"===",
... | Get name.
Can remove table prefix.
@param bool $withoutPrefix
@return string | [
"Get",
"name",
".",
"Can",
"remove",
"table",
"prefix",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L168-L176 |
202,579 | eureka-framework/component-orm | src/Orm/Column.php | Column.setData | protected function setData(\stdClass $column)
{
$this->setName($column->Field);
$this->setIsPrimaryKey(($column->Key === 'PRI'));
$this->setIsKey(!empty($column->Key));
$this->setType($column->Type);
$this->setIsNullable(($column->Null === 'YES'));
$this->setDefault($... | php | protected function setData(\stdClass $column)
{
$this->setName($column->Field);
$this->setIsPrimaryKey(($column->Key === 'PRI'));
$this->setIsKey(!empty($column->Key));
$this->setType($column->Type);
$this->setIsNullable(($column->Null === 'YES'));
$this->setDefault($... | [
"protected",
"function",
"setData",
"(",
"\\",
"stdClass",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"setName",
"(",
"$",
"column",
"->",
"Field",
")",
";",
"$",
"this",
"->",
"setIsPrimaryKey",
"(",
"(",
"$",
"column",
"->",
"Key",
"===",
"'PRI'",
... | Set column data from db query
@param \stdClass $column
@return self | [
"Set",
"column",
"data",
"from",
"db",
"query"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L264-L275 |
202,580 | eureka-framework/component-orm | src/Orm/Column.php | Column.getMethodNameGet | public function getMethodNameGet()
{
$methodName = str_replace(' ', '', ucwords(str_replace(array(
'_is_', '_has_', '_in_', '_',
), ' ', strtolower($this->getName(true)))));
$type = $this->getType();
switch (true) {
case ($type instanceof Type\TypeBool) && s... | php | public function getMethodNameGet()
{
$methodName = str_replace(' ', '', ucwords(str_replace(array(
'_is_', '_has_', '_in_', '_',
), ' ', strtolower($this->getName(true)))));
$type = $this->getType();
switch (true) {
case ($type instanceof Type\TypeBool) && s... | [
"public",
"function",
"getMethodNameGet",
"(",
")",
"{",
"$",
"methodName",
"=",
"str_replace",
"(",
"' '",
",",
"''",
",",
"ucwords",
"(",
"str_replace",
"(",
"array",
"(",
"'_is_'",
",",
"'_has_'",
",",
"'_in_'",
",",
"'_'",
",",
")",
",",
"' '",
","... | Get method name for getter.
@return string | [
"Get",
"method",
"name",
"for",
"getter",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L302-L326 |
202,581 | eureka-framework/component-orm | src/Orm/Column.php | Column.setExtra | protected function setExtra($extra)
{
if (empty($extra)) {
return $this;
}
switch ($extra) {
case 'auto_increment':
$this->isAutoIncrement = true;
break;
}
return $this;
} | php | protected function setExtra($extra)
{
if (empty($extra)) {
return $this;
}
switch ($extra) {
case 'auto_increment':
$this->isAutoIncrement = true;
break;
}
return $this;
} | [
"protected",
"function",
"setExtra",
"(",
"$",
"extra",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"extra",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"switch",
"(",
"$",
"extra",
")",
"{",
"case",
"'auto_increment'",
":",
"$",
"this",
"->",
"isA... | Set extra info.
@param string $extra
@return self | [
"Set",
"extra",
"info",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L430-L443 |
202,582 | eureka-framework/component-orm | src/Orm/Column.php | Column.getCheck | protected function getCheck()
{
$check = array(0 => '', 1 => '');
$type = $this->getType();
switch ($type->getType()) {
case 'int':
case 'float':
if ($type->isUnsigned()) {
$check[1] = '\UnderflowException';
$c... | php | protected function getCheck()
{
$check = array(0 => '', 1 => '');
$type = $this->getType();
switch ($type->getType()) {
case 'int':
case 'float':
if ($type->isUnsigned()) {
$check[1] = '\UnderflowException';
$c... | [
"protected",
"function",
"getCheck",
"(",
")",
"{",
"$",
"check",
"=",
"array",
"(",
"0",
"=>",
"''",
",",
"1",
"=>",
"''",
")",
";",
"$",
"type",
"=",
"$",
"this",
"->",
"getType",
"(",
")",
";",
"switch",
"(",
"$",
"type",
"->",
"getType",
"(... | Get check condition for numeric values & underflow if necessary.
@return string | [
"Get",
"check",
"condition",
"for",
"numeric",
"values",
"&",
"underflow",
"if",
"necessary",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/Column.php#L450-L469 |
202,583 | SimpleAPI/Core | sources/Router.php | Router.run | public function run($url = null, $method = null)
{
$route = $this->altoRouter->match($url, $method);
if (!$route) {
throw new NotFoundException(((isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : (($url != null) ? $url : "/")) . " is not reach... | php | public function run($url = null, $method = null)
{
$route = $this->altoRouter->match($url, $method);
if (!$route) {
throw new NotFoundException(((isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : (($url != null) ? $url : "/")) . " is not reach... | [
"public",
"function",
"run",
"(",
"$",
"url",
"=",
"null",
",",
"$",
"method",
"=",
"null",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"altoRouter",
"->",
"match",
"(",
"$",
"url",
",",
"$",
"method",
")",
";",
"if",
"(",
"!",
"$",
"route"... | This function runs the router and call the apropriate | [
"This",
"function",
"runs",
"the",
"router",
"and",
"call",
"the",
"apropriate"
] | 4545f1e8f2242832d4b3dc9bb59541a086a01188 | https://github.com/SimpleAPI/Core/blob/4545f1e8f2242832d4b3dc9bb59541a086a01188/sources/Router.php#L94-L114 |
202,584 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByFiles | public function filterByFiles($files = null, $comparison = null)
{
if (is_array($files)) {
$useMinMax = false;
if (isset($files['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_FILES, $files['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterByFiles($files = null, $comparison = null)
{
if (is_array($files)) {
$useMinMax = false;
if (isset($files['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_FILES, $files['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterByFiles",
"(",
"$",
"files",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"files",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"files... | Filter the query on the files column
Example usage:
<code>
$query->filterByFiles(1234); // WHERE files = 1234
$query->filterByFiles(array(12, 34)); // WHERE files IN (12, 34)
$query->filterByFiles(array('min' => 12)); // WHERE files > 12
</code>
@param mixed $files The value to use as filter.
Use scalar values fo... | [
"Filter",
"the",
"query",
"on",
"the",
"files",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L501-L522 |
202,585 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterBySubcats | public function filterBySubcats($subcats = null, $comparison = null)
{
if (is_array($subcats)) {
$useMinMax = false;
if (isset($subcats['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_SUBCATS, $subcats['min'], Criteria::GREATER_EQUAL);
$useMinMax... | php | public function filterBySubcats($subcats = null, $comparison = null)
{
if (is_array($subcats)) {
$useMinMax = false;
if (isset($subcats['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_SUBCATS, $subcats['min'], Criteria::GREATER_EQUAL);
$useMinMax... | [
"public",
"function",
"filterBySubcats",
"(",
"$",
"subcats",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"subcats",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
... | Filter the query on the subcats column
Example usage:
<code>
$query->filterBySubcats(1234); // WHERE subcats = 1234
$query->filterBySubcats(array(12, 34)); // WHERE subcats IN (12, 34)
$query->filterBySubcats(array('min' => 12)); // WHERE subcats > 12
</code>
@param mixed $subcats The value to use as filter.
Use ... | [
"Filter",
"the",
"query",
"on",
"the",
"subcats",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L542-L563 |
202,586 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterBySize | public function filterBySize($size = null, $comparison = null)
{
if (is_array($size)) {
$useMinMax = false;
if (isset($size['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_SIZE, $size['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterBySize($size = null, $comparison = null)
{
if (is_array($size)) {
$useMinMax = false;
if (isset($size['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_SIZE, $size['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterBySize",
"(",
"$",
"size",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"size",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"size",
... | Filter the query on the size column
Example usage:
<code>
$query->filterBySize(1234); // WHERE size = 1234
$query->filterBySize(array(12, 34)); // WHERE size IN (12, 34)
$query->filterBySize(array('min' => 12)); // WHERE size > 12
</code>
@param mixed $size The value to use as filter.
Use scalar values for equali... | [
"Filter",
"the",
"query",
"on",
"the",
"size",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L624-L645 |
202,587 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByHidden | public function filterByHidden($hidden = null, $comparison = null)
{
if (is_string($hidden)) {
$hidden = in_array(strtolower($hidden), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(CategoryTableMap::COL_HIDDEN, $hidden, $comparison... | php | public function filterByHidden($hidden = null, $comparison = null)
{
if (is_string($hidden)) {
$hidden = in_array(strtolower($hidden), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(CategoryTableMap::COL_HIDDEN, $hidden, $comparison... | [
"public",
"function",
"filterByHidden",
"(",
"$",
"hidden",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"hidden",
")",
")",
"{",
"$",
"hidden",
"=",
"in_array",
"(",
"strtolower",
"(",
"$",
"hidden",
... | Filter the query on the hidden column
Example usage:
<code>
$query->filterByHidden(true); // WHERE hidden = true
$query->filterByHidden('yes'); // WHERE hidden = true
</code>
@param boolean|string $hidden The value to use as filter.
Non-boolean arguments are converted using the following rules:
* 1, '1', 'true', ... | [
"Filter",
"the",
"query",
"on",
"the",
"hidden",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L665-L672 |
202,588 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByTreeLeft | public function filterByTreeLeft($treeLeft = null, $comparison = null)
{
if (is_array($treeLeft)) {
$useMinMax = false;
if (isset($treeLeft['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_LEFT, $treeLeft['min'], Criteria::GREATER_EQUAL);
$us... | php | public function filterByTreeLeft($treeLeft = null, $comparison = null)
{
if (is_array($treeLeft)) {
$useMinMax = false;
if (isset($treeLeft['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_LEFT, $treeLeft['min'], Criteria::GREATER_EQUAL);
$us... | [
"public",
"function",
"filterByTreeLeft",
"(",
"$",
"treeLeft",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"treeLeft",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",... | Filter the query on the tree_left column
Example usage:
<code>
$query->filterByTreeLeft(1234); // WHERE tree_left = 1234
$query->filterByTreeLeft(array(12, 34)); // WHERE tree_left IN (12, 34)
$query->filterByTreeLeft(array('min' => 12)); // WHERE tree_left > 12
</code>
@param mixed $treeLeft The value to use as ... | [
"Filter",
"the",
"query",
"on",
"the",
"tree_left",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L778-L799 |
202,589 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByTreeRight | public function filterByTreeRight($treeRight = null, $comparison = null)
{
if (is_array($treeRight)) {
$useMinMax = false;
if (isset($treeRight['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_RIGHT, $treeRight['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByTreeRight($treeRight = null, $comparison = null)
{
if (is_array($treeRight)) {
$useMinMax = false;
if (isset($treeRight['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_RIGHT, $treeRight['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByTreeRight",
"(",
"$",
"treeRight",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"treeRight",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"... | Filter the query on the tree_right column
Example usage:
<code>
$query->filterByTreeRight(1234); // WHERE tree_right = 1234
$query->filterByTreeRight(array(12, 34)); // WHERE tree_right IN (12, 34)
$query->filterByTreeRight(array('min' => 12)); // WHERE tree_right > 12
</code>
@param mixed $treeRight The value to... | [
"Filter",
"the",
"query",
"on",
"the",
"tree_right",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L819-L840 |
202,590 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByTreeLevel | public function filterByTreeLevel($treeLevel = null, $comparison = null)
{
if (is_array($treeLevel)) {
$useMinMax = false;
if (isset($treeLevel['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_LEVEL, $treeLevel['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByTreeLevel($treeLevel = null, $comparison = null)
{
if (is_array($treeLevel)) {
$useMinMax = false;
if (isset($treeLevel['min'])) {
$this->addUsingAlias(CategoryTableMap::COL_TREE_LEVEL, $treeLevel['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByTreeLevel",
"(",
"$",
"treeLevel",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"treeLevel",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"... | Filter the query on the tree_level column
Example usage:
<code>
$query->filterByTreeLevel(1234); // WHERE tree_level = 1234
$query->filterByTreeLevel(array(12, 34)); // WHERE tree_level IN (12, 34)
$query->filterByTreeLevel(array('min' => 12)); // WHERE tree_level > 12
</code>
@param mixed $treeLevel The value to... | [
"Filter",
"the",
"query",
"on",
"the",
"tree_level",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L860-L881 |
202,591 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterBySource | public function filterBySource($source, $comparison = null)
{
if ($source instanceof \Attogram\SharedMedia\Orm\Source) {
return $this
->addUsingAlias(CategoryTableMap::COL_SOURCE_ID, $source->getId(), $comparison);
} elseif ($source instanceof ObjectCollection) {
... | php | public function filterBySource($source, $comparison = null)
{
if ($source instanceof \Attogram\SharedMedia\Orm\Source) {
return $this
->addUsingAlias(CategoryTableMap::COL_SOURCE_ID, $source->getId(), $comparison);
} elseif ($source instanceof ObjectCollection) {
... | [
"public",
"function",
"filterBySource",
"(",
"$",
"source",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"source",
"instanceof",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"Source",
")",
"{",
"return",
"$",
"this",
"->",
... | Filter the query by a related \Attogram\SharedMedia\Orm\Source object
@param \Attogram\SharedMedia\Orm\Source|ObjectCollection $source The related object(s) to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@throws \Propel\Runtime\Exception\PropelExcepti... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"Source",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L893-L908 |
202,592 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.filterByC2M | public function filterByC2M($c2M, $comparison = null)
{
if ($c2M instanceof \Attogram\SharedMedia\Orm\C2M) {
return $this
->addUsingAlias(CategoryTableMap::COL_ID, $c2M->getCategoryId(), $comparison);
} elseif ($c2M instanceof ObjectCollection) {
return $this
... | php | public function filterByC2M($c2M, $comparison = null)
{
if ($c2M instanceof \Attogram\SharedMedia\Orm\C2M) {
return $this
->addUsingAlias(CategoryTableMap::COL_ID, $c2M->getCategoryId(), $comparison);
} elseif ($c2M instanceof ObjectCollection) {
return $this
... | [
"public",
"function",
"filterByC2M",
"(",
"$",
"c2M",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"c2M",
"instanceof",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"C2M",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingA... | Filter the query by a related \Attogram\SharedMedia\Orm\C2M object
@param \Attogram\SharedMedia\Orm\C2M|ObjectCollection $c2M the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildCategoryQuery The current query, for fluid int... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"Attogram",
"\\",
"SharedMedia",
"\\",
"Orm",
"\\",
"C2M",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L968-L981 |
202,593 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.descendantsOf | public function descendantsOf(ChildCategory $category)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, $category->getLeftValue(), Criteria::GREATER_THAN)
->addUsingAlias(ChildCategory::LEFT_COL, $category->getRightValue(), Criteria::LESS_THAN);
} | php | public function descendantsOf(ChildCategory $category)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, $category->getLeftValue(), Criteria::GREATER_THAN)
->addUsingAlias(ChildCategory::LEFT_COL, $category->getRightValue(), Criteria::LESS_THAN);
} | [
"public",
"function",
"descendantsOf",
"(",
"ChildCategory",
"$",
"category",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ChildCategory",
"::",
"LEFT_COL",
",",
"$",
"category",
"->",
"getLeftValue",
"(",
")",
",",
"Criteria",
"::",
"GREATER_... | Filter the query to restrict the result to descendants of an object
@param ChildCategory $category The object to use for descendant search
@return $this|ChildCategoryQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"to",
"restrict",
"the",
"result",
"to",
"descendants",
"of",
"an",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1258-L1263 |
202,594 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.childrenOf | public function childrenOf(ChildCategory $category)
{
return $this
->descendantsOf($category)
->addUsingAlias(ChildCategory::LEVEL_COL, $category->getLevel() + 1, Criteria::EQUAL);
} | php | public function childrenOf(ChildCategory $category)
{
return $this
->descendantsOf($category)
->addUsingAlias(ChildCategory::LEVEL_COL, $category->getLevel() + 1, Criteria::EQUAL);
} | [
"public",
"function",
"childrenOf",
"(",
"ChildCategory",
"$",
"category",
")",
"{",
"return",
"$",
"this",
"->",
"descendantsOf",
"(",
"$",
"category",
")",
"->",
"addUsingAlias",
"(",
"ChildCategory",
"::",
"LEVEL_COL",
",",
"$",
"category",
"->",
"getLevel"... | Filter the query to restrict the result to children of an object
@param ChildCategory $category The object to use for child search
@return $this|ChildCategoryQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"to",
"restrict",
"the",
"result",
"to",
"children",
"of",
"an",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1287-L1292 |
202,595 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.siblingsOf | public function siblingsOf(ChildCategory $category, ConnectionInterface $con = null)
{
if ($category->isRoot()) {
return $this->
add(ChildCategory::LEVEL_COL, '1<>1', Criteria::CUSTOM);
} else {
return $this
->childrenOf($category->getParent($c... | php | public function siblingsOf(ChildCategory $category, ConnectionInterface $con = null)
{
if ($category->isRoot()) {
return $this->
add(ChildCategory::LEVEL_COL, '1<>1', Criteria::CUSTOM);
} else {
return $this
->childrenOf($category->getParent($c... | [
"public",
"function",
"siblingsOf",
"(",
"ChildCategory",
"$",
"category",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"category",
"->",
"isRoot",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"ChildCateg... | Filter the query to restrict the result to siblings of an object.
The result does not include the object passed as parameter.
@param ChildCategory $category The object to use for sibling search
@param ConnectionInterface $con Connection to use.
@return $this|ChildCategoryQuery The current query, for fluid... | [
"Filter",
"the",
"query",
"to",
"restrict",
"the",
"result",
"to",
"siblings",
"of",
"an",
"object",
".",
"The",
"result",
"does",
"not",
"include",
"the",
"object",
"passed",
"as",
"parameter",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1303-L1313 |
202,596 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.ancestorsOf | public function ancestorsOf(ChildCategory $category)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, $category->getLeftValue(), Criteria::LESS_THAN)
->addUsingAlias(ChildCategory::RIGHT_COL, $category->getRightValue(), Criteria::GREATER_THAN);
} | php | public function ancestorsOf(ChildCategory $category)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, $category->getLeftValue(), Criteria::LESS_THAN)
->addUsingAlias(ChildCategory::RIGHT_COL, $category->getRightValue(), Criteria::GREATER_THAN);
} | [
"public",
"function",
"ancestorsOf",
"(",
"ChildCategory",
"$",
"category",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ChildCategory",
"::",
"LEFT_COL",
",",
"$",
"category",
"->",
"getLeftValue",
"(",
")",
",",
"Criteria",
"::",
"LESS_THAN"... | Filter the query to restrict the result to ancestors of an object
@param ChildCategory $category The object to use for ancestors search
@return $this|ChildCategoryQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"to",
"restrict",
"the",
"result",
"to",
"ancestors",
"of",
"an",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1322-L1327 |
202,597 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.orderByBranch | public function orderByBranch($reverse = false)
{
if ($reverse) {
return $this
->addDescendingOrderByColumn(ChildCategory::LEFT_COL);
} else {
return $this
->addAscendingOrderByColumn(ChildCategory::LEFT_COL);
}
} | php | public function orderByBranch($reverse = false)
{
if ($reverse) {
return $this
->addDescendingOrderByColumn(ChildCategory::LEFT_COL);
} else {
return $this
->addAscendingOrderByColumn(ChildCategory::LEFT_COL);
}
} | [
"public",
"function",
"orderByBranch",
"(",
"$",
"reverse",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"reverse",
")",
"{",
"return",
"$",
"this",
"->",
"addDescendingOrderByColumn",
"(",
"ChildCategory",
"::",
"LEFT_COL",
")",
";",
"}",
"else",
"{",
"return"... | Order the result by branch, i.e. natural tree order
@param bool $reverse if true, reverses the order
@return $this|ChildCategoryQuery The current query, for fluid interface | [
"Order",
"the",
"result",
"by",
"branch",
"i",
".",
"e",
".",
"natural",
"tree",
"order"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1351-L1360 |
202,598 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.orderByLevel | public function orderByLevel($reverse = false)
{
if ($reverse) {
return $this
->addDescendingOrderByColumn(ChildCategory::LEVEL_COL)
->addDescendingOrderByColumn(ChildCategory::LEFT_COL);
} else {
return $this
->addAscendingOrde... | php | public function orderByLevel($reverse = false)
{
if ($reverse) {
return $this
->addDescendingOrderByColumn(ChildCategory::LEVEL_COL)
->addDescendingOrderByColumn(ChildCategory::LEFT_COL);
} else {
return $this
->addAscendingOrde... | [
"public",
"function",
"orderByLevel",
"(",
"$",
"reverse",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"reverse",
")",
"{",
"return",
"$",
"this",
"->",
"addDescendingOrderByColumn",
"(",
"ChildCategory",
"::",
"LEVEL_COL",
")",
"->",
"addDescendingOrderByColumn",
... | Order the result by level, the closer to the root first
@param bool $reverse if true, reverses the order
@return $this|ChildCategoryQuery The current query, for fluid interface | [
"Order",
"the",
"result",
"by",
"level",
"the",
"closer",
"to",
"the",
"root",
"first"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1369-L1380 |
202,599 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php | CategoryQuery.findRoot | public function findRoot(ConnectionInterface $con = null)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, 1, Criteria::EQUAL)
->findOne($con);
} | php | public function findRoot(ConnectionInterface $con = null)
{
return $this
->addUsingAlias(ChildCategory::LEFT_COL, 1, Criteria::EQUAL)
->findOne($con);
} | [
"public",
"function",
"findRoot",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"ChildCategory",
"::",
"LEFT_COL",
",",
"1",
",",
"Criteria",
"::",
"EQUAL",
")",
"->",
"findOne",
"(",
"$",... | Returns the root node for the tree
@param ConnectionInterface $con Connection to use.
@return ChildCategory The tree root object | [
"Returns",
"the",
"root",
"node",
"for",
"the",
"tree"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/CategoryQuery.php#L1389-L1394 |
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.