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
3,400
phramework/database
src/PostgreSQL.php
PostgreSQL.executeAndFetch
public function executeAndFetch($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); $statement->execute($parameters); $data = $statement->fetch(PDO::FETCH_ASSOC); $statement->closeCursor(); return ( $castModel && $data ...
php
public function executeAndFetch($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); $statement->execute($parameters); $data = $statement->fetch(PDO::FETCH_ASSOC); $statement->closeCursor(); return ( $castModel && $data ...
[ "public", "function", "executeAndFetch", "(", "$", "query", ",", "$", "parameters", "=", "[", "]", ",", "$", "castModel", "=", "null", ")", "{", "$", "statement", "=", "$", "this", "->", "link", "->", "prepare", "(", "$", "query", ")", ";", "$", "s...
Execute a query and fetch first row as associative array @param string $query @param array $parameters Query parameters @return array Returns a single row from database @throws \Phramework\Exceptions\DatabaseException
[ "Execute", "a", "query", "and", "fetch", "first", "row", "as", "associative", "array" ]
12726d81917981aa447bb58b76e21762592aab8f
https://github.com/phramework/database/blob/12726d81917981aa447bb58b76e21762592aab8f/src/PostgreSQL.php#L126-L139
3,401
phramework/database
src/PostgreSQL.php
PostgreSQL.bindExecuteAndFetch
public function bindExecuteAndFetch($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); foreach ($parameters as $index => $paramProperties) { if (is_object($paramProperties)) { $paramProperties = (array) $paramProperties; ...
php
public function bindExecuteAndFetch($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); foreach ($parameters as $index => $paramProperties) { if (is_object($paramProperties)) { $paramProperties = (array) $paramProperties; ...
[ "public", "function", "bindExecuteAndFetch", "(", "$", "query", ",", "$", "parameters", "=", "[", "]", ",", "$", "castModel", "=", "null", ")", "{", "$", "statement", "=", "$", "this", "->", "link", "->", "prepare", "(", "$", "query", ")", ";", "fore...
Bind Execute a query and fetch first row as associative array @param string $query Query string @param array $parameters Query parameters @return array @throws \Phramework\Exceptions\DatabaseException
[ "Bind", "Execute", "a", "query", "and", "fetch", "first", "row", "as", "associative", "array" ]
12726d81917981aa447bb58b76e21762592aab8f
https://github.com/phramework/database/blob/12726d81917981aa447bb58b76e21762592aab8f/src/PostgreSQL.php#L274-L302
3,402
phramework/database
src/PostgreSQL.php
PostgreSQL.bindExecuteAndFetchAll
public function bindExecuteAndFetchAll($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); foreach ($parameters as $index => $paramProperties) { if (is_object($paramProperties)) { $paramProperties = (array) $paramProperties; ...
php
public function bindExecuteAndFetchAll($query, $parameters = [], $castModel = null) { $statement = $this->link->prepare($query); foreach ($parameters as $index => $paramProperties) { if (is_object($paramProperties)) { $paramProperties = (array) $paramProperties; ...
[ "public", "function", "bindExecuteAndFetchAll", "(", "$", "query", ",", "$", "parameters", "=", "[", "]", ",", "$", "castModel", "=", "null", ")", "{", "$", "statement", "=", "$", "this", "->", "link", "->", "prepare", "(", "$", "query", ")", ";", "f...
Bind Execute a query and fetch all rows as associative array @param string $query Query string @param array $parameters Query parameters @return array[] @throws \Phramework\Exceptions\DatabaseException
[ "Bind", "Execute", "a", "query", "and", "fetch", "all", "rows", "as", "associative", "array" ]
12726d81917981aa447bb58b76e21762592aab8f
https://github.com/phramework/database/blob/12726d81917981aa447bb58b76e21762592aab8f/src/PostgreSQL.php#L312-L339
3,403
uthando-cms/uthando-common
src/UthandoCommon/Db/Table/AbstractTable.php
AbstractTable.getById
public function getById($id) { $id = (int) $id; $rowSet = $this->getTableGateway()->select([$this->getPrimaryKey() => $id]); $row = $rowSet->current(); return $row; }
php
public function getById($id) { $id = (int) $id; $rowSet = $this->getTableGateway()->select([$this->getPrimaryKey() => $id]); $row = $rowSet->current(); return $row; }
[ "public", "function", "getById", "(", "$", "id", ")", "{", "$", "id", "=", "(", "int", ")", "$", "id", ";", "$", "rowSet", "=", "$", "this", "->", "getTableGateway", "(", ")", "->", "select", "(", "[", "$", "this", "->", "getPrimaryKey", "(", ")"...
Get one row by it's id @param $id @return array|\ArrayObject|ModelInterface|null
[ "Get", "one", "row", "by", "it", "s", "id" ]
feb915da5d26b60f536282e1bc3ad5c22e53f485
https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Db/Table/AbstractTable.php#L58-L64
3,404
uthando-cms/uthando-common
src/UthandoCommon/Db/Table/AbstractTable.php
AbstractTable.fetchAll
public function fetchAll($paginated = false) { if ($paginated) { $paginatorAdapter = new DbTableGateway($this->tableGateway); $paginator = new Paginator($paginatorAdapter); return $paginator; } $resultSet = $this->getTableGateway()->select(); ...
php
public function fetchAll($paginated = false) { if ($paginated) { $paginatorAdapter = new DbTableGateway($this->tableGateway); $paginator = new Paginator($paginatorAdapter); return $paginator; } $resultSet = $this->getTableGateway()->select(); ...
[ "public", "function", "fetchAll", "(", "$", "paginated", "=", "false", ")", "{", "if", "(", "$", "paginated", ")", "{", "$", "paginatorAdapter", "=", "new", "DbTableGateway", "(", "$", "this", "->", "tableGateway", ")", ";", "$", "paginator", "=", "new",...
Fetch all records. @param bool $paginated @return ResultSet
[ "Fetch", "all", "records", "." ]
feb915da5d26b60f536282e1bc3ad5c22e53f485
https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Db/Table/AbstractTable.php#L72-L84
3,405
phplegends/routes
src/Router.php
Router.findByUri
public function findByUri($uri) { return $this->routes->first(function ($route) use($uri) { return $route->match($uri); }); }
php
public function findByUri($uri) { return $this->routes->first(function ($route) use($uri) { return $route->match($uri); }); }
[ "public", "function", "findByUri", "(", "$", "uri", ")", "{", "return", "$", "this", "->", "routes", "->", "first", "(", "function", "(", "$", "route", ")", "use", "(", "$", "uri", ")", "{", "return", "$", "route", "->", "match", "(", "$", "uri", ...
Finds the route via uri @param string $uri @return \PHPLegends\Routes\Route | null
[ "Finds", "the", "route", "via", "uri" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L82-L88
3,406
phplegends/routes
src/Router.php
Router.findByName
public function findByName($name) { return $this->routes->first(function ($route) use($name) { return $route->getName() === $name; }); }
php
public function findByName($name) { return $this->routes->first(function ($route) use($name) { return $route->getName() === $name; }); }
[ "public", "function", "findByName", "(", "$", "name", ")", "{", "return", "$", "this", "->", "routes", "->", "first", "(", "function", "(", "$", "route", ")", "use", "(", "$", "name", ")", "{", "return", "$", "route", "->", "getName", "(", ")", "==...
Returns route by given name @param string $name @return \PHPLegends\Routes\Route | null
[ "Returns", "route", "by", "given", "name" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L144-L150
3,407
phplegends/routes
src/Router.php
Router.group
public function group(array $options, \Closure $closure) { $group = new static(null, $options); $closure->bindTo($group)->__invoke($group); $this->getCollection()->addAll($group->getCollection()); return $this; }
php
public function group(array $options, \Closure $closure) { $group = new static(null, $options); $closure->bindTo($group)->__invoke($group); $this->getCollection()->addAll($group->getCollection()); return $this; }
[ "public", "function", "group", "(", "array", "$", "options", ",", "\\", "Closure", "$", "closure", ")", "{", "$", "group", "=", "new", "static", "(", "null", ",", "$", "options", ")", ";", "$", "closure", "->", "bindTo", "(", "$", "group", ")", "->...
Create a group with specific options @param array $options @param \Closure $closure
[ "Create", "a", "group", "with", "specific", "options" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L324-L334
3,408
phplegends/routes
src/Router.php
Router.routable
public function routable($class, $prefix = null) { $class = $this->resolveRoutableClassValue($class); $router = (new RoutableInspector($class))->generateRoutables(null, $prefix); $this->mergeRouter($router); return $this; }
php
public function routable($class, $prefix = null) { $class = $this->resolveRoutableClassValue($class); $router = (new RoutableInspector($class))->generateRoutables(null, $prefix); $this->mergeRouter($router); return $this; }
[ "public", "function", "routable", "(", "$", "class", ",", "$", "prefix", "=", "null", ")", "{", "$", "class", "=", "$", "this", "->", "resolveRoutableClassValue", "(", "$", "class", ")", ";", "$", "router", "=", "(", "new", "RoutableInspector", "(", "$...
Import all routable method for a class @param string $class @return self
[ "Import", "all", "routable", "method", "for", "a", "class" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L342-L351
3,409
phplegends/routes
src/Router.php
Router.resolveNameValue
protected function resolveNameValue($name) { if ($name === null) return null; if ($prefixName = $this->getPrefixName()) { $name = $prefixName . $name; } return $name; }
php
protected function resolveNameValue($name) { if ($name === null) return null; if ($prefixName = $this->getPrefixName()) { $name = $prefixName . $name; } return $name; }
[ "protected", "function", "resolveNameValue", "(", "$", "name", ")", "{", "if", "(", "$", "name", "===", "null", ")", "return", "null", ";", "if", "(", "$", "prefixName", "=", "$", "this", "->", "getPrefixName", "(", ")", ")", "{", "$", "name", "=", ...
Result value of name @param string|null $name @return string|null
[ "Result", "value", "of", "name" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L424-L434
3,410
phplegends/routes
src/Router.php
Router.setOptions
public function setOptions(array $args) { $this->options = $args += [ 'filters' => [], 'name' => null, 'namespace' => null, 'prefix' => null, ]; $args['namespace'] && $this->setNamespace($args['namespace']); $args['prefix'] && $this->setPrefixPath($args['prefix']); ...
php
public function setOptions(array $args) { $this->options = $args += [ 'filters' => [], 'name' => null, 'namespace' => null, 'prefix' => null, ]; $args['namespace'] && $this->setNamespace($args['namespace']); $args['prefix'] && $this->setPrefixPath($args['prefix']); ...
[ "public", "function", "setOptions", "(", "array", "$", "args", ")", "{", "$", "this", "->", "options", "=", "$", "args", "+=", "[", "'filters'", "=>", "[", "]", ",", "'name'", "=>", "null", ",", "'namespace'", "=>", "null", ",", "'prefix'", "=>", "nu...
Set value via array options @param array $args @return self
[ "Set", "value", "via", "array", "options" ]
7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec
https://github.com/phplegends/routes/blob/7b571362c4d9b190ad51bc5e8c4d96bfd03f31ec/src/Router.php#L524-L543
3,411
helsingborg-stad/easy-to-read-alternative
source/php/Admin/Options.php
Options.acfLocationRulesMatch
public function acfLocationRulesMatch($match, $rule, $options) { $post_types = get_field('easy_reading_posttypes', 'option'); if ($post_types) { if ($rule['operator'] == "==") { $match = (isset($options['post_type']) && in_array($options['post_type'], $post_types) && $op...
php
public function acfLocationRulesMatch($match, $rule, $options) { $post_types = get_field('easy_reading_posttypes', 'option'); if ($post_types) { if ($rule['operator'] == "==") { $match = (isset($options['post_type']) && in_array($options['post_type'], $post_types) && $op...
[ "public", "function", "acfLocationRulesMatch", "(", "$", "match", ",", "$", "rule", ",", "$", "options", ")", "{", "$", "post_types", "=", "get_field", "(", "'easy_reading_posttypes'", ",", "'option'", ")", ";", "if", "(", "$", "post_types", ")", "{", "if"...
Matching custom location rule @param boolean $match If rule match or not @param array $rule Current rule that to match against @param array $options Data about the current edit screen @return boolean
[ "Matching", "custom", "location", "rule" ]
0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0
https://github.com/helsingborg-stad/easy-to-read-alternative/blob/0dfd7ea9168cbbde145d8b9e58a69ded3fa82ae0/source/php/Admin/Options.php#L54-L67
3,412
williamespindola/abstract-http-client
src/QueryString/ExtraQueryString.php
ExtraQueryString.getUriWithExtraString
public function getUriWithExtraString(string $uri): String { if (!$this->queryString) { return $uri; } return $uri . '?' . implode('&', $this->queryString); }
php
public function getUriWithExtraString(string $uri): String { if (!$this->queryString) { return $uri; } return $uri . '?' . implode('&', $this->queryString); }
[ "public", "function", "getUriWithExtraString", "(", "string", "$", "uri", ")", ":", "String", "{", "if", "(", "!", "$", "this", "->", "queryString", ")", "{", "return", "$", "uri", ";", "}", "return", "$", "uri", ".", "'?'", ".", "implode", "(", "'&'...
Get uri with extra query strings @param String $uri String uri @return String Uri concatenated with extra query string
[ "Get", "uri", "with", "extra", "query", "strings" ]
92eedeb6084dd9a6934c24bccd0b88039ce482dd
https://github.com/williamespindola/abstract-http-client/blob/92eedeb6084dd9a6934c24bccd0b88039ce482dd/src/QueryString/ExtraQueryString.php#L87-L94
3,413
sellerlabs/nucleus
src/SellerLabs/Nucleus/Support/Flick.php
Flick.go
public function go($input) { Arguments::define(Boa::readMap())->define($input); $map = ComplexFactory::toReadMap($this->functions); if ($map->member($input)) { /** @var callable $function */ $function = Maybe::fromJust($map->lookup($input)); return $fun...
php
public function go($input) { Arguments::define(Boa::readMap())->define($input); $map = ComplexFactory::toReadMap($this->functions); if ($map->member($input)) { /** @var callable $function */ $function = Maybe::fromJust($map->lookup($input)); return $fun...
[ "public", "function", "go", "(", "$", "input", ")", "{", "Arguments", "::", "define", "(", "Boa", "::", "readMap", "(", ")", ")", "->", "define", "(", "$", "input", ")", ";", "$", "map", "=", "ComplexFactory", "::", "toReadMap", "(", "$", "this", "...
Run the flick on input. @param string|int $input @throws UnknownKeyException @return mixed
[ "Run", "the", "flick", "on", "input", "." ]
c05d9c23d424a6bd5ab2e29140805cc6e37e4623
https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Flick.php#L88-L107
3,414
AthensFramework/Core
src/etc/StringUtils.php
StringUtils.slugify
public static function slugify($string) { // Replace non-alpha-numerics with dashes $string = strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'), array('','-',''), $string)); // Trim dashes from the left side of the string $string = ltrim($string, "-"); /...
php
public static function slugify($string) { // Replace non-alpha-numerics with dashes $string = strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'), array('','-',''), $string)); // Trim dashes from the left side of the string $string = ltrim($string, "-"); /...
[ "public", "static", "function", "slugify", "(", "$", "string", ")", "{", "// Replace non-alpha-numerics with dashes", "$", "string", "=", "strtolower", "(", "preg_replace", "(", "array", "(", "'/[^a-zA-Z0-9 -]/'", ",", "'/[ -]+/'", ",", "'/^-|-$/'", ")", ",", "arr...
Turn a string into a slug @param string $string @return string
[ "Turn", "a", "string", "into", "a", "slug" ]
6237b914b9f6aef6b2fcac23094b657a86185340
https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/etc/StringUtils.php#L28-L40
3,415
AthensFramework/Core
src/etc/StringUtils.php
StringUtils.toTitleCase
public static function toTitleCase($string) { // Replace underscores, dashes with spaces $string = str_replace(["_", "-"], " ", $string); // Break the string into an array of words $name_array = explode(" ", $string); // Words not-to capitalize $smallWords = [ ...
php
public static function toTitleCase($string) { // Replace underscores, dashes with spaces $string = str_replace(["_", "-"], " ", $string); // Break the string into an array of words $name_array = explode(" ", $string); // Words not-to capitalize $smallWords = [ ...
[ "public", "static", "function", "toTitleCase", "(", "$", "string", ")", "{", "// Replace underscores, dashes with spaces", "$", "string", "=", "str_replace", "(", "[", "\"_\"", ",", "\"-\"", "]", ",", "\" \"", ",", "$", "string", ")", ";", "// Break the string i...
Format a string into title case @param string $string @return string
[ "Format", "a", "string", "into", "title", "case" ]
6237b914b9f6aef6b2fcac23094b657a86185340
https://github.com/AthensFramework/Core/blob/6237b914b9f6aef6b2fcac23094b657a86185340/src/etc/StringUtils.php#L48-L81
3,416
orchestral/studio
src/Traits/PublishRoutes.php
PublishRoutes.publishRoute
protected function publishRoute(Filesystem $filesystem, $route) { if (is_null($route)) { return ; } $routeFile = app_path('Http/routes.php'); if ($filesystem->exists($routeFile) && $filesystem->exists($route)) { $filesystem->append($routeFile, $filesystem->g...
php
protected function publishRoute(Filesystem $filesystem, $route) { if (is_null($route)) { return ; } $routeFile = app_path('Http/routes.php'); if ($filesystem->exists($routeFile) && $filesystem->exists($route)) { $filesystem->append($routeFile, $filesystem->g...
[ "protected", "function", "publishRoute", "(", "Filesystem", "$", "filesystem", ",", "$", "route", ")", "{", "if", "(", "is_null", "(", "$", "route", ")", ")", "{", "return", ";", "}", "$", "routeFile", "=", "app_path", "(", "'Http/routes.php'", ")", ";",...
Appends routes. @param \Illuminate\Filesystem\Filesystem $filesystem @param string|null $route @return void
[ "Appends", "routes", "." ]
254d0d3296ff8b52cdb7f4eab2423fea2bcced3b
https://github.com/orchestral/studio/blob/254d0d3296ff8b52cdb7f4eab2423fea2bcced3b/src/Traits/PublishRoutes.php#L17-L30
3,417
theluckyteam/php-jira
src/jira/Entity/ReadonlyIssue.php
ReadonlyIssue.getProperty
private function getProperty($name) { if (!Property::exists($this->properties, $name)) { throw new \Exception(); } return Property::get($this->properties, $name); }
php
private function getProperty($name) { if (!Property::exists($this->properties, $name)) { throw new \Exception(); } return Property::get($this->properties, $name); }
[ "private", "function", "getProperty", "(", "$", "name", ")", "{", "if", "(", "!", "Property", "::", "exists", "(", "$", "this", "->", "properties", ",", "$", "name", ")", ")", "{", "throw", "new", "\\", "Exception", "(", ")", ";", "}", "return", "P...
Returns value of property @param string $name Name of property @return mixed Value of property @throws \Exception If unknown property
[ "Returns", "value", "of", "property" ]
5a50ab4fc57dd77239f1b7e9c87738318c258c38
https://github.com/theluckyteam/php-jira/blob/5a50ab4fc57dd77239f1b7e9c87738318c258c38/src/jira/Entity/ReadonlyIssue.php#L102-L109
3,418
sgoendoer/json
src/JSONTools.php
JSONTools.getJSONErrorAsString
public static function getJSONErrorAsString() { switch(json_last_error()) { case JSON_ERROR_NONE: $error = NULL; break; case JSON_ERROR_DEPTH: $error = 'The maximum stack depth has been exceeded.'; break; case JSON_ERROR_STATE_MISMATCH: $error = 'Invalid or malformed JSON.'; ...
php
public static function getJSONErrorAsString() { switch(json_last_error()) { case JSON_ERROR_NONE: $error = NULL; break; case JSON_ERROR_DEPTH: $error = 'The maximum stack depth has been exceeded.'; break; case JSON_ERROR_STATE_MISMATCH: $error = 'Invalid or malformed JSON.'; ...
[ "public", "static", "function", "getJSONErrorAsString", "(", ")", "{", "switch", "(", "json_last_error", "(", ")", ")", "{", "case", "JSON_ERROR_NONE", ":", "$", "error", "=", "NULL", ";", "break", ";", "case", "JSON_ERROR_DEPTH", ":", "$", "error", "=", "...
returns a string representation of the last JSON error @return string The error string. NULL, if no error was found
[ "returns", "a", "string", "representation", "of", "the", "last", "JSON", "error" ]
31fb7330d185e6f91bb260c4bf55050982f0bad1
https://github.com/sgoendoer/json/blob/31fb7330d185e6f91bb260c4bf55050982f0bad1/src/JSONTools.php#L18-L67
3,419
sgoendoer/json
src/JSONTools.php
JSONTools.containsValidJSON
public static function containsValidJSON($string) { try { $result = json_decode($string); } catch(\Exception $e) {} if(self::getJSONError() === NULL) return true; else return false; }
php
public static function containsValidJSON($string) { try { $result = json_decode($string); } catch(\Exception $e) {} if(self::getJSONError() === NULL) return true; else return false; }
[ "public", "static", "function", "containsValidJSON", "(", "$", "string", ")", "{", "try", "{", "$", "result", "=", "json_decode", "(", "$", "string", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "}", "if", "(", "self", "::", ...
Determines if a string contains a valid, decodable JSON object. @param $string string to be tested @return true, if given string contains valid JSON, else false
[ "Determines", "if", "a", "string", "contains", "a", "valid", "decodable", "JSON", "object", "." ]
31fb7330d185e6f91bb260c4bf55050982f0bad1
https://github.com/sgoendoer/json/blob/31fb7330d185e6f91bb260c4bf55050982f0bad1/src/JSONTools.php#L76-L89
3,420
joaogl/base
src/Base.php
Base.getSettingsMethods
protected function getSettingsMethods() { if (empty($this->settingsMethods)) { $settings = $this->getSettingsRepository(); $methods = get_class_methods($settings); $this->settingsMethods = array_diff($methods, ['__construct']); } return $this-...
php
protected function getSettingsMethods() { if (empty($this->settingsMethods)) { $settings = $this->getSettingsRepository(); $methods = get_class_methods($settings); $this->settingsMethods = array_diff($methods, ['__construct']); } return $this-...
[ "protected", "function", "getSettingsMethods", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "settingsMethods", ")", ")", "{", "$", "settings", "=", "$", "this", "->", "getSettingsRepository", "(", ")", ";", "$", "methods", "=", "get_class_met...
Returns all accessible methods on the associated settings repository. @return array
[ "Returns", "all", "accessible", "methods", "on", "the", "associated", "settings", "repository", "." ]
e6a4e9f4d3c75efc92545941ea5c9810d3291b56
https://github.com/joaogl/base/blob/e6a4e9f4d3c75efc92545941ea5c9810d3291b56/src/Base.php#L186-L197
3,421
joaogl/base
src/Base.php
Base.Log
public function Log($logMessage) { $target = null; if ($user = Sentinel::getUser()) if ($user != null) $target = $user->id; $log = $this->getLogsRepository()->create(['log' => $logMessage, 'ip' => Request::ip(), 'target' => $target]); }
php
public function Log($logMessage) { $target = null; if ($user = Sentinel::getUser()) if ($user != null) $target = $user->id; $log = $this->getLogsRepository()->create(['log' => $logMessage, 'ip' => Request::ip(), 'target' => $target]); }
[ "public", "function", "Log", "(", "$", "logMessage", ")", "{", "$", "target", "=", "null", ";", "if", "(", "$", "user", "=", "Sentinel", "::", "getUser", "(", ")", ")", "if", "(", "$", "user", "!=", "null", ")", "$", "target", "=", "$", "user", ...
Create a log @param $logMessage
[ "Create", "a", "log" ]
e6a4e9f4d3c75efc92545941ea5c9810d3291b56
https://github.com/joaogl/base/blob/e6a4e9f4d3c75efc92545941ea5c9810d3291b56/src/Base.php#L225-L234
3,422
joaogl/base
src/Base.php
Base.TargettedLog
public function TargettedLog($logMessage, $userTarget) { $log = $this->getLogsRepository()->create(['log' => $logMessage, 'target' => $userTarget, 'ip' => Request::ip()]); }
php
public function TargettedLog($logMessage, $userTarget) { $log = $this->getLogsRepository()->create(['log' => $logMessage, 'target' => $userTarget, 'ip' => Request::ip()]); }
[ "public", "function", "TargettedLog", "(", "$", "logMessage", ",", "$", "userTarget", ")", "{", "$", "log", "=", "$", "this", "->", "getLogsRepository", "(", ")", "->", "create", "(", "[", "'log'", "=>", "$", "logMessage", ",", "'target'", "=>", "$", "...
Create a log and associates it to a user @param $logMessage @param $userTarget
[ "Create", "a", "log", "and", "associates", "it", "to", "a", "user" ]
e6a4e9f4d3c75efc92545941ea5c9810d3291b56
https://github.com/joaogl/base/blob/e6a4e9f4d3c75efc92545941ea5c9810d3291b56/src/Base.php#L242-L245
3,423
frogsystem/legacy-bridge
src/Services/Config/ConfigData.php
ConfigData.setConfigByFile
public function setConfigByFile($name) { $file = "/{$name}.cfg.php"; if ('production' !== FS2_ENV) { $file_env = "/{$name}-{FS2_ENV}.cfg.php"; if (file_exists(FS2CONFIG . $file_env)) { $file = $file_env; } } $config = array(); ...
php
public function setConfigByFile($name) { $file = "/{$name}.cfg.php"; if ('production' !== FS2_ENV) { $file_env = "/{$name}-{FS2_ENV}.cfg.php"; if (file_exists(FS2CONFIG . $file_env)) { $file = $file_env; } } $config = array(); ...
[ "public", "function", "setConfigByFile", "(", "$", "name", ")", "{", "$", "file", "=", "\"/{$name}.cfg.php\"", ";", "if", "(", "'production'", "!==", "FS2_ENV", ")", "{", "$", "file_env", "=", "\"/{$name}-{FS2_ENV}.cfg.php\"", ";", "if", "(", "file_exists", "(...
set multiple config entries from a config file does not change any database data @param $name @return ConfigData
[ "set", "multiple", "config", "entries", "from", "a", "config", "file", "does", "not", "change", "any", "database", "data" ]
a4ea3bea701e2b737c119a5d89b7778e8745658c
https://github.com/frogsystem/legacy-bridge/blob/a4ea3bea701e2b737c119a5d89b7778e8745658c/src/Services/Config/ConfigData.php#L76-L91
3,424
vutran/wpmvc-core
src/Common/Bootstrap.php
Bootstrap.autoloadPath
public function autoloadPath($path) { $files = glob($path); if ($files && count($files)) { foreach ($files as $file) { if (file_exists($file) && is_dir($file)) { $this->autoloadPath($file . "/*"); } if (file_exists($file...
php
public function autoloadPath($path) { $files = glob($path); if ($files && count($files)) { foreach ($files as $file) { if (file_exists($file) && is_dir($file)) { $this->autoloadPath($file . "/*"); } if (file_exists($file...
[ "public", "function", "autoloadPath", "(", "$", "path", ")", "{", "$", "files", "=", "glob", "(", "$", "path", ")", ";", "if", "(", "$", "files", "&&", "count", "(", "$", "files", ")", ")", "{", "foreach", "(", "$", "files", "as", "$", "file", ...
Autoloads all files in the given path @access public @param string $path @return void
[ "Autoloads", "all", "files", "in", "the", "given", "path" ]
4081be36116ae8e79abfd182d783d28d0fb42219
https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Common/Bootstrap.php#L82-L95
3,425
vutran/wpmvc-core
src/Common/Bootstrap.php
Bootstrap.createView
public function createView($file = null) { $view = new View($this->getTemplatePath() . '/app/views/'); if ($file) { $view->setFile($file); } return $view; }
php
public function createView($file = null) { $view = new View($this->getTemplatePath() . '/app/views/'); if ($file) { $view->setFile($file); } return $view; }
[ "public", "function", "createView", "(", "$", "file", "=", "null", ")", "{", "$", "view", "=", "new", "View", "(", "$", "this", "->", "getTemplatePath", "(", ")", ".", "'/app/views/'", ")", ";", "if", "(", "$", "file", ")", "{", "$", "view", "->", ...
Create a new View instance @access public @param string $file (default : null) @return \WPMVC\Models\View
[ "Create", "a", "new", "View", "instance" ]
4081be36116ae8e79abfd182d783d28d0fb42219
https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Common/Bootstrap.php#L200-L207
3,426
vutran/wpmvc-core
src/Common/Bootstrap.php
Bootstrap.init
public function init() { $coreViewPath = WP::applyFilters('wpmvc_core_views_path', $this->getCorePath() . '/Views/'); $appViewPath = WP::applyFilters('wpmvc_app_views_path', $this->getTemplatePath() . '/app/views/'); // Create a new view and set the default path as the current path $...
php
public function init() { $coreViewPath = WP::applyFilters('wpmvc_core_views_path', $this->getCorePath() . '/Views/'); $appViewPath = WP::applyFilters('wpmvc_app_views_path', $this->getTemplatePath() . '/app/views/'); // Create a new view and set the default path as the current path $...
[ "public", "function", "init", "(", ")", "{", "$", "coreViewPath", "=", "WP", "::", "applyFilters", "(", "'wpmvc_core_views_path'", ",", "$", "this", "->", "getCorePath", "(", ")", ".", "'/Views/'", ")", ";", "$", "appViewPath", "=", "WP", "::", "applyFilte...
Begin the routing @access public @return void
[ "Begin", "the", "routing" ]
4081be36116ae8e79abfd182d783d28d0fb42219
https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Common/Bootstrap.php#L215-L278
3,427
CodeCollab/Theme
src/Theme.php
Theme.setTheme
public function setTheme(string $theme) { if (!$this->isPathValid($theme)) { throw new NotFoundException('The theme cannot be found.'); } $this->validateTheme($theme); $themeInfo = $this->getThemeInfo($theme); if (array_key_exists('parent', $themeInfo)) { ...
php
public function setTheme(string $theme) { if (!$this->isPathValid($theme)) { throw new NotFoundException('The theme cannot be found.'); } $this->validateTheme($theme); $themeInfo = $this->getThemeInfo($theme); if (array_key_exists('parent', $themeInfo)) { ...
[ "public", "function", "setTheme", "(", "string", "$", "theme", ")", "{", "if", "(", "!", "$", "this", "->", "isPathValid", "(", "$", "theme", ")", ")", "{", "throw", "new", "NotFoundException", "(", "'The theme cannot be found.'", ")", ";", "}", "$", "th...
Sets a theme @param string $theme The name of the theme to set @throws \CodeCollab\Theme\NotFoundException When the theme cannot be found @throws \CodeCollab\Theme\InvalidException When the theme is not valid
[ "Sets", "a", "theme" ]
6e3a3fde06f0ca8e26c947e28010c53f569393d7
https://github.com/CodeCollab/Theme/blob/6e3a3fde06f0ca8e26c947e28010c53f569393d7/src/Theme.php#L62-L79
3,428
CodeCollab/Theme
src/Theme.php
Theme.isPathValid
private function isPathValid(string $theme): bool { if (!is_dir(rtrim($this->themePath, '/') . '/' . $theme)) { return false; } return true; }
php
private function isPathValid(string $theme): bool { if (!is_dir(rtrim($this->themePath, '/') . '/' . $theme)) { return false; } return true; }
[ "private", "function", "isPathValid", "(", "string", "$", "theme", ")", ":", "bool", "{", "if", "(", "!", "is_dir", "(", "rtrim", "(", "$", "this", "->", "themePath", ",", "'/'", ")", ".", "'/'", ".", "$", "theme", ")", ")", "{", "return", "false",...
Checks whether the theme directory exists @param string $theme The name of the theme @return bool True when the directory of the theme exists
[ "Checks", "whether", "the", "theme", "directory", "exists" ]
6e3a3fde06f0ca8e26c947e28010c53f569393d7
https://github.com/CodeCollab/Theme/blob/6e3a3fde06f0ca8e26c947e28010c53f569393d7/src/Theme.php#L100-L107
3,429
CodeCollab/Theme
src/Theme.php
Theme.validateTheme
private function validateTheme(string $theme) { if (!file_exists($this->themePath . '/' . $theme . '/info.json')) { throw new InvalidException('The theme (`' . $theme . '`) is missing the configuration file (`info.json`).'); } try { $themeInfo = $this->getThemeInfo($...
php
private function validateTheme(string $theme) { if (!file_exists($this->themePath . '/' . $theme . '/info.json')) { throw new InvalidException('The theme (`' . $theme . '`) is missing the configuration file (`info.json`).'); } try { $themeInfo = $this->getThemeInfo($...
[ "private", "function", "validateTheme", "(", "string", "$", "theme", ")", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "themePath", ".", "'/'", ".", "$", "theme", ".", "'/info.json'", ")", ")", "{", "throw", "new", "InvalidException", "(",...
Checks whether the layout of the theme directory is valid @param string $theme The name of the theme @throws \CodeCollab\Theme\InvalidException When the theme is not valid
[ "Checks", "whether", "the", "layout", "of", "the", "theme", "directory", "is", "valid" ]
6e3a3fde06f0ca8e26c947e28010c53f569393d7
https://github.com/CodeCollab/Theme/blob/6e3a3fde06f0ca8e26c947e28010c53f569393d7/src/Theme.php#L116-L133
3,430
CodeCollab/Theme
src/Theme.php
Theme.load
public function load(string $file): string { if ($this->childTheme && file_exists($this->themePath . '/' . $this->childTheme['name'] . $file)) { $this->preventDirectoryTraversal( $this->themePath . '/' . $this->childTheme['name'], $this->themePath . '/' . $this->c...
php
public function load(string $file): string { if ($this->childTheme && file_exists($this->themePath . '/' . $this->childTheme['name'] . $file)) { $this->preventDirectoryTraversal( $this->themePath . '/' . $this->childTheme['name'], $this->themePath . '/' . $this->c...
[ "public", "function", "load", "(", "string", "$", "file", ")", ":", "string", "{", "if", "(", "$", "this", "->", "childTheme", "&&", "file_exists", "(", "$", "this", "->", "themePath", ".", "'/'", ".", "$", "this", "->", "childTheme", "[", "'name'", ...
Loads a file from the theme This method will first try to load the file from the child theme (if available) @param string $file The file to load (relative to the theme directory) @return string The filename to load @throws \CodeCollab\Theme\NotFoundException When the file cannot be found in either the theme or the ...
[ "Loads", "a", "file", "from", "the", "theme" ]
6e3a3fde06f0ca8e26c947e28010c53f569393d7
https://github.com/CodeCollab/Theme/blob/6e3a3fde06f0ca8e26c947e28010c53f569393d7/src/Theme.php#L146-L167
3,431
CodeCollab/Theme
src/Theme.php
Theme.preventDirectoryTraversal
private function preventDirectoryTraversal(string $themePath, string $filePath) { $themePath = realpath($themePath); $filePath = realpath($filePath); if ($filePath === false || strpos($filePath, $themePath) !== 0) { throw new DirectoryTraversalException('Trying to load a file o...
php
private function preventDirectoryTraversal(string $themePath, string $filePath) { $themePath = realpath($themePath); $filePath = realpath($filePath); if ($filePath === false || strpos($filePath, $themePath) !== 0) { throw new DirectoryTraversalException('Trying to load a file o...
[ "private", "function", "preventDirectoryTraversal", "(", "string", "$", "themePath", ",", "string", "$", "filePath", ")", "{", "$", "themePath", "=", "realpath", "(", "$", "themePath", ")", ";", "$", "filePath", "=", "realpath", "(", "$", "filePath", ")", ...
Validates the file path to prevent directory traversal @param string $themePath The base path of the theme @param string $filePath The file path @throws DirectoryTraversalException
[ "Validates", "the", "file", "path", "to", "prevent", "directory", "traversal" ]
6e3a3fde06f0ca8e26c947e28010c53f569393d7
https://github.com/CodeCollab/Theme/blob/6e3a3fde06f0ca8e26c947e28010c53f569393d7/src/Theme.php#L177-L185
3,432
HustleWorks/chute
src/DTO/TransferObject.php
TransferObject.throwUnlessCorrectSubclass
private function throwUnlessCorrectSubclass($property, $value) { $typeUsedToBe = $this->getTypeUsedToBe($property); if ($typeUsedToBe === "object") { $classUsedToBe = $this->getClassUsedToBe($property); if (!is_subclass_of($value, $classUsedToBe)) { throw ne...
php
private function throwUnlessCorrectSubclass($property, $value) { $typeUsedToBe = $this->getTypeUsedToBe($property); if ($typeUsedToBe === "object") { $classUsedToBe = $this->getClassUsedToBe($property); if (!is_subclass_of($value, $classUsedToBe)) { throw ne...
[ "private", "function", "throwUnlessCorrectSubclass", "(", "$", "property", ",", "$", "value", ")", "{", "$", "typeUsedToBe", "=", "$", "this", "->", "getTypeUsedToBe", "(", "$", "property", ")", ";", "if", "(", "$", "typeUsedToBe", "===", "\"object\"", ")", ...
Throw Unless Correct Subclass @param $property @param $value @throws Exception
[ "Throw", "Unless", "Correct", "Subclass" ]
ede5a83dd74925e734b9b0063502c7e4b9085cb2
https://github.com/HustleWorks/chute/blob/ede5a83dd74925e734b9b0063502c7e4b9085cb2/src/DTO/TransferObject.php#L117-L128
3,433
HustleWorks/chute
src/DTO/TransferObject.php
TransferObject.throwUnlessCorrectType
private function throwUnlessCorrectType($property, $value) { $typeUsedToBe = $this->getTypeUsedToBe($property); if ($typeUsedToBe !== "null") { $typeWantsToBe = $this->getTypeWantsToBe($value); if ($typeUsedToBe !== $typeWantsToBe) { throw new Exception(); ...
php
private function throwUnlessCorrectType($property, $value) { $typeUsedToBe = $this->getTypeUsedToBe($property); if ($typeUsedToBe !== "null") { $typeWantsToBe = $this->getTypeWantsToBe($value); if ($typeUsedToBe !== $typeWantsToBe) { throw new Exception(); ...
[ "private", "function", "throwUnlessCorrectType", "(", "$", "property", ",", "$", "value", ")", "{", "$", "typeUsedToBe", "=", "$", "this", "->", "getTypeUsedToBe", "(", "$", "property", ")", ";", "if", "(", "$", "typeUsedToBe", "!==", "\"null\"", ")", "{",...
Throw Unless Correct Type @param $property @param $value @throws Exception
[ "Throw", "Unless", "Correct", "Type" ]
ede5a83dd74925e734b9b0063502c7e4b9085cb2
https://github.com/HustleWorks/chute/blob/ede5a83dd74925e734b9b0063502c7e4b9085cb2/src/DTO/TransferObject.php#L137-L148
3,434
phramework/database
src/Operations/Create.php
Create.create
public static function create( $attributes, $table, $schema = null, $return = self::RETURN_ID ) { if (is_object($attributes)) { $attributes = (array) $attributes; } $driver = Database::getAdapterName(); //prepare query $query_keys...
php
public static function create( $attributes, $table, $schema = null, $return = self::RETURN_ID ) { if (is_object($attributes)) { $attributes = (array) $attributes; } $driver = Database::getAdapterName(); //prepare query $query_keys...
[ "public", "static", "function", "create", "(", "$", "attributes", ",", "$", "table", ",", "$", "schema", "=", "null", ",", "$", "return", "=", "self", "::", "RETURN_ID", ")", "{", "if", "(", "is_object", "(", "$", "attributes", ")", ")", "{", "$", ...
Create a new record in database @param array|object $attributes Key-value array or object with records's attributes @param string $table Table's name @param string|null $schema *[Optional]* Table's schema, default is null for no schema @param integer $return Return method type - if **`RETURN_ID`** will r...
[ "Create", "a", "new", "record", "in", "database" ]
12726d81917981aa447bb58b76e21762592aab8f
https://github.com/phramework/database/blob/12726d81917981aa447bb58b76e21762592aab8f/src/Operations/Create.php#L48-L116
3,435
lucidphp/resource
src/Loader/ChainedLoader.php
ChainedLoader.resolve
public function resolve($resource) { foreach ($this->loaders() as $loader) { if ($loader->supports($resource)) { return $loader; } } throw new LoaderException('No matching loader found.'); }
php
public function resolve($resource) { foreach ($this->loaders() as $loader) { if ($loader->supports($resource)) { return $loader; } } throw new LoaderException('No matching loader found.'); }
[ "public", "function", "resolve", "(", "$", "resource", ")", "{", "foreach", "(", "$", "this", "->", "loaders", "(", ")", "as", "$", "loader", ")", "{", "if", "(", "$", "loader", "->", "supports", "(", "$", "resource", ")", ")", "{", "return", "$", ...
Resolve a loader. @param mixed $resource @return LoaderInterface
[ "Resolve", "a", "loader", "." ]
49120588d399fbffa5ce4dd471bedb93f5da7780
https://github.com/lucidphp/resource/blob/49120588d399fbffa5ce4dd471bedb93f5da7780/src/Loader/ChainedLoader.php#L49-L58
3,436
cgTag/php-exceptions
src/ValueException.php
ValueException.describe
public static function describe($value): string { if (is_array($value)) { $value = '<array>'; } elseif (is_object($value) || is_callable($value) || is_iterable($value)) { $value = sprintf('<%s>', get_class($value)); } else { $value = (string)$value;...
php
public static function describe($value): string { if (is_array($value)) { $value = '<array>'; } elseif (is_object($value) || is_callable($value) || is_iterable($value)) { $value = sprintf('<%s>', get_class($value)); } else { $value = (string)$value;...
[ "public", "static", "function", "describe", "(", "$", "value", ")", ":", "string", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "value", "=", "'<array>'", ";", "}", "elseif", "(", "is_object", "(", "$", "value", ")", "||", "is...
Converts any value into a short descriptive label. @param $value @return string
[ "Converts", "any", "value", "into", "a", "short", "descriptive", "label", "." ]
cc7b232b029e00a1b2d4deb65aa00d88f9bd0e3e
https://github.com/cgTag/php-exceptions/blob/cc7b232b029e00a1b2d4deb65aa00d88f9bd0e3e/src/ValueException.php#L18-L32
3,437
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._copy
public function _copy( $srcFilePath, $dstFilePath, $fname = false ) { if ( $fname ) $fname .= "::_copy($srcFilePath, $dstFilePath)"; else $fname = "_copy($srcFilePath, $dstFilePath)"; // fetch source file metadata $metaData = $this->_fetchMetadata( $srcFilePa...
php
public function _copy( $srcFilePath, $dstFilePath, $fname = false ) { if ( $fname ) $fname .= "::_copy($srcFilePath, $dstFilePath)"; else $fname = "_copy($srcFilePath, $dstFilePath)"; // fetch source file metadata $metaData = $this->_fetchMetadata( $srcFilePa...
[ "public", "function", "_copy", "(", "$", "srcFilePath", ",", "$", "dstFilePath", ",", "$", "fname", "=", "false", ")", "{", "if", "(", "$", "fname", ")", "$", "fname", ".=", "\"::_copy($srcFilePath, $dstFilePath)\"", ";", "else", "$", "fname", "=", "\"_cop...
Creates a copy of a file in DB+DFS @see eZDFSFileHandler::fileCopy @see _copyInner @param string $srcFilePath Source file @param string $dstFilePath Destination file @param bool|string $fname Optional caller name for debugging @return bool
[ "Creates", "a", "copy", "of", "a", "file", "in", "DB", "+", "DFS" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L171-L189
3,438
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._purge
public function _purge( $filePath, $onlyExpired = false, $expiry = false, $fname = false ) { if ( $fname ) $fname .= "::_purge($filePath)"; else $fname = "_purge($filePath)"; $sql = "DELETE FROM " . $this->dbTable( $filePath ) . " WHERE name_hash=" . $this->_md5( $fil...
php
public function _purge( $filePath, $onlyExpired = false, $expiry = false, $fname = false ) { if ( $fname ) $fname .= "::_purge($filePath)"; else $fname = "_purge($filePath)"; $sql = "DELETE FROM " . $this->dbTable( $filePath ) . " WHERE name_hash=" . $this->_md5( $fil...
[ "public", "function", "_purge", "(", "$", "filePath", ",", "$", "onlyExpired", "=", "false", ",", "$", "expiry", "=", "false", ",", "$", "fname", "=", "false", ")", "{", "if", "(", "$", "fname", ")", "$", "fname", ".=", "\"::_purge($filePath)\"", ";", ...
Purges meta-data and file-data for a file entry Will only expire a single file. Use _purgeByLike to purge multiple files @see eZDFSFileHandler::purge @see _purgeByLike @param string $filePath Path of the file to purge @param bool $onlyExpired Only purges expired files @param bool|int $expiry @param bool|string $fname...
[ "Purges", "meta", "-", "data", "and", "file", "-", "data", "for", "a", "file", "entry", "Will", "only", "expire", "a", "single", "file", ".", "Use", "_purgeByLike", "to", "purge", "multiple", "files" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L251-L275
3,439
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._purgeByLike
public function _purgeByLike( $like, $onlyExpired = false, $limit = 50, $expiry = false, $fname = false ) { if ( $fname ) $fname .= "::_purgeByLike($like, $onlyExpired)"; else $fname = "_purgeByLike($like, $onlyExpired)"; // common query part used for both DELETE and...
php
public function _purgeByLike( $like, $onlyExpired = false, $limit = 50, $expiry = false, $fname = false ) { if ( $fname ) $fname .= "::_purgeByLike($like, $onlyExpired)"; else $fname = "_purgeByLike($like, $onlyExpired)"; // common query part used for both DELETE and...
[ "public", "function", "_purgeByLike", "(", "$", "like", ",", "$", "onlyExpired", "=", "false", ",", "$", "limit", "=", "50", ",", "$", "expiry", "=", "false", ",", "$", "fname", "=", "false", ")", "{", "if", "(", "$", "fname", ")", "$", "fname", ...
Purges meta-data and file-data for files matching a pattern using a SQL LIKE syntax. This method should also remove the files from disk @see eZDFSFileHandler::purge @see _purge @param string $like SQL LIKE string applied to ezdfsfile.name to look for files to purge @param bool $onlyExpired Only purge expired files (e...
[ "Purges", "meta", "-", "data", "and", "file", "-", "data", "for", "files", "matching", "a", "pattern", "using", "a", "SQL", "LIKE", "syntax", ".", "This", "method", "should", "also", "remove", "the", "files", "from", "disk" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L298-L359
3,440
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._delete
public function _delete( $filePath, $insideOfTransaction = false, $fname = false ) { if ( $fname ) $fname .= "::_delete($filePath)"; else $fname = "_delete($filePath)"; // @todo Check if this is required: _protect will already take care of // checking if...
php
public function _delete( $filePath, $insideOfTransaction = false, $fname = false ) { if ( $fname ) $fname .= "::_delete($filePath)"; else $fname = "_delete($filePath)"; // @todo Check if this is required: _protect will already take care of // checking if...
[ "public", "function", "_delete", "(", "$", "filePath", ",", "$", "insideOfTransaction", "=", "false", ",", "$", "fname", "=", "false", ")", "{", "if", "(", "$", "fname", ")", "$", "fname", ".=", "\"::_delete($filePath)\"", ";", "else", "$", "fname", "=",...
Deletes a file from DB The file won't be removed from disk, _purge has to be used for this. Only single files will be deleted, to delete multiple files, _deleteByLike has to be used. @see eZDFSFileHandler::fileDelete @see eZDFSFileHandler::delete @see _deleteInner @see _deleteByLike @param string $filePath Path of th...
[ "Deletes", "a", "file", "from", "DB", "The", "file", "won", "t", "be", "removed", "from", "disk", "_purge", "has", "to", "be", "used", "for", "this", ".", "Only", "single", "files", "will", "be", "deleted", "to", "delete", "multiple", "files", "_deleteBy...
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L379-L398
3,441
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._deleteInner
protected function _deleteInner( $filePath, $fname ) { if ( !$this->_query( "UPDATE " . $this->dbTable( $filePath ) . " SET mtime=-ABS(mtime), expired=1 WHERE name_hash=" . $this->_md5( $filePath ), $fname ) ) $this->_fail( "Deleting file $filePath failed" ); return true; }
php
protected function _deleteInner( $filePath, $fname ) { if ( !$this->_query( "UPDATE " . $this->dbTable( $filePath ) . " SET mtime=-ABS(mtime), expired=1 WHERE name_hash=" . $this->_md5( $filePath ), $fname ) ) $this->_fail( "Deleting file $filePath failed" ); return true; }
[ "protected", "function", "_deleteInner", "(", "$", "filePath", ",", "$", "fname", ")", "{", "if", "(", "!", "$", "this", "->", "_query", "(", "\"UPDATE \"", ".", "$", "this", "->", "dbTable", "(", "$", "filePath", ")", ".", "\" SET mtime=-ABS(mtime), expir...
Callback method used by by _delete to delete a single file @param string $filePath Path of the file to delete @param string $fname Optional caller name for debugging @return bool
[ "Callback", "method", "used", "by", "by", "_delete", "to", "delete", "a", "single", "file" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L407-L412
3,442
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._deleteByLike
public function _deleteByLike( $like, $fname = false ) { if ( $fname ) $fname .= "::_deleteByLike($like)"; else $fname = "_deleteByLike($like)"; return $this->_protect( array( $this, '_deleteByLikeInner' ), $fname, $like, $fname ); ...
php
public function _deleteByLike( $like, $fname = false ) { if ( $fname ) $fname .= "::_deleteByLike($like)"; else $fname = "_deleteByLike($like)"; return $this->_protect( array( $this, '_deleteByLikeInner' ), $fname, $like, $fname ); ...
[ "public", "function", "_deleteByLike", "(", "$", "like", ",", "$", "fname", "=", "false", ")", "{", "if", "(", "$", "fname", ")", "$", "fname", ".=", "\"::_deleteByLike($like)\"", ";", "else", "$", "fname", "=", "\"_deleteByLike($like)\"", ";", "return", "...
Deletes multiple files using a SQL LIKE statement Use _delete if you need to delete single files @see eZDFSFileHandler::fileDelete @see _deleteByLikeInner @see _delete @param string $like SQL LIKE condition applied to ezdfsfile.name to look for files to delete. Will use name_trunk if the LIKE string matches a filetyp...
[ "Deletes", "multiple", "files", "using", "a", "SQL", "LIKE", "statement", "Use", "_delete", "if", "you", "need", "to", "delete", "single", "files" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L430-L438
3,443
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._storeInner
function _storeInner( $filePath, $datatype, $scope, $fname ) { // Insert file metadata. clearstatcache(); $fileMTime = filemtime( $filePath ); $contentLength = filesize( $filePath ); $filePathHash = md5( $filePath ); $nameTrunk = self::nameTrunk( $filePath, $scope ); ...
php
function _storeInner( $filePath, $datatype, $scope, $fname ) { // Insert file metadata. clearstatcache(); $fileMTime = filemtime( $filePath ); $contentLength = filesize( $filePath ); $filePathHash = md5( $filePath ); $nameTrunk = self::nameTrunk( $filePath, $scope ); ...
[ "function", "_storeInner", "(", "$", "filePath", ",", "$", "datatype", ",", "$", "scope", ",", "$", "fname", ")", "{", "// Insert file metadata.", "clearstatcache", "(", ")", ";", "$", "fileMTime", "=", "filemtime", "(", "$", "filePath", ")", ";", "$", "...
Callback function used to perform the actual file store operation @param string $filePath @param string $datatype @param string $scope @param string $fname @see eZDFSFileHandlerMySQLBackend::_store() @return bool
[ "Callback", "function", "used", "to", "perform", "the", "actual", "file", "store", "operation" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L956-L987
3,444
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._getFileList
public function _getFileList( $scopes = false, $excludeScopes = false, $limit = false, $path = false ) { $filePathList = array(); $tables = array_unique( array( $this->metaDataTable, $this->metaDataTableCache ) ); foreach ( $tables as $table ) ...
php
public function _getFileList( $scopes = false, $excludeScopes = false, $limit = false, $path = false ) { $filePathList = array(); $tables = array_unique( array( $this->metaDataTable, $this->metaDataTableCache ) ); foreach ( $tables as $table ) ...
[ "public", "function", "_getFileList", "(", "$", "scopes", "=", "false", ",", "$", "excludeScopes", "=", "false", ",", "$", "limit", "=", "false", ",", "$", "path", "=", "false", ")", "{", "$", "filePathList", "=", "array", "(", ")", ";", "$", "tables...
Gets the list of cluster files, filtered by the optional params @see eZDFSFileHandler::getFileList @param array|bool $scopes filter by array of scopes to include in the list @param bool $excludeScopes if true, $scopes param acts as an exclude filter @param array|bool $limit limits the search to offset limit[0], limit...
[ "Gets", "the", "list", "of", "cluster", "files", "filtered", "by", "the", "optional", "params" ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L1063-L1100
3,445
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._selectOneRow
protected function _selectOneRow( $query, $fname, $error = false, $debug = false ) { return $this->_selectOne( $query, $fname, $error, $debug, PDO::FETCH_NUM ); }
php
protected function _selectOneRow( $query, $fname, $error = false, $debug = false ) { return $this->_selectOne( $query, $fname, $error, $debug, PDO::FETCH_NUM ); }
[ "protected", "function", "_selectOneRow", "(", "$", "query", ",", "$", "fname", ",", "$", "error", "=", "false", ",", "$", "debug", "=", "false", ")", "{", "return", "$", "this", "->", "_selectOne", "(", "$", "query", ",", "$", "fname", ",", "$", "...
Runs a select query and returns one numeric indexed row from the result If there are more than one row it will fail and exit, if 0 it returns false. @param string $query @param string $fname The function name that started the query, should contain relevant arguments in the text. @param bool|string $error Sent to _erro...
[ "Runs", "a", "select", "query", "and", "returns", "one", "numeric", "indexed", "row", "from", "the", "result", "If", "there", "are", "more", "than", "one", "row", "it", "will", "fail", "and", "exit", "if", "0", "it", "returns", "false", "." ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L1234-L1237
3,446
informaticatrentina/ezpostgresqlcluster
clustering/dfs/ezpostsgresqlbackend.php
eZDFSFileHandlerPostgresqlBackend._selectOneAssoc
protected function _selectOneAssoc( $query, $fname, $error = false, $debug = false ) { return $this->_selectOne( $query, $fname, $error, $debug, PDO::FETCH_ASSOC ); }
php
protected function _selectOneAssoc( $query, $fname, $error = false, $debug = false ) { return $this->_selectOne( $query, $fname, $error, $debug, PDO::FETCH_ASSOC ); }
[ "protected", "function", "_selectOneAssoc", "(", "$", "query", ",", "$", "fname", ",", "$", "error", "=", "false", ",", "$", "debug", "=", "false", ")", "{", "return", "$", "this", "->", "_selectOne", "(", "$", "query", ",", "$", "fname", ",", "$", ...
Runs a select query and returns one associative row from the result. If there are more than one row it will fail and exit, if 0 it returns false. @param string $query @param string $fname The function name that started the query, should contain relevant arguments in the text. @param bool|string $error Sent to _error(...
[ "Runs", "a", "select", "query", "and", "returns", "one", "associative", "row", "from", "the", "result", "." ]
18da29f32703360b2457abd82e385b47fb140ae9
https://github.com/informaticatrentina/ezpostgresqlcluster/blob/18da29f32703360b2457abd82e385b47fb140ae9/clustering/dfs/ezpostsgresqlbackend.php#L1253-L1256
3,447
adrianyg7/Acl
src/Console/Commands/RegisterPermissions.php
RegisterPermissions.permissionsToRegister
public function permissionsToRegister() { $config = config('acl'); $permissionPlaceholders = array_get($config, 'permission_placeholders'); $additionalPermissions = array_get($config, 'additional'); $permissionsToRegister = []; $routes = array_filter($this->router->getRoutes...
php
public function permissionsToRegister() { $config = config('acl'); $permissionPlaceholders = array_get($config, 'permission_placeholders'); $additionalPermissions = array_get($config, 'additional'); $permissionsToRegister = []; $routes = array_filter($this->router->getRoutes...
[ "public", "function", "permissionsToRegister", "(", ")", "{", "$", "config", "=", "config", "(", "'acl'", ")", ";", "$", "permissionPlaceholders", "=", "array_get", "(", "$", "config", ",", "'permission_placeholders'", ")", ";", "$", "additionalPermissions", "="...
Retreives the permissions to be registered. @return array
[ "Retreives", "the", "permissions", "to", "be", "registered", "." ]
b3d69199405ca7406b33991884f6bb2e6f85f4e5
https://github.com/adrianyg7/Acl/blob/b3d69199405ca7406b33991884f6bb2e6f85f4e5/src/Console/Commands/RegisterPermissions.php#L89-L109
3,448
flavorzyb/wechat
src/XmlParser.php
XmlParser.load
public function load($xmlString) { $data = $this->parserXml($xmlString); if (!isset($data['MsgType'])) { throw new \RuntimeException("can not found MsgType"); } // event message if (WxReceive::MSG_TYPE_EVENT == $data['MsgType']) { $parser = new Ev...
php
public function load($xmlString) { $data = $this->parserXml($xmlString); if (!isset($data['MsgType'])) { throw new \RuntimeException("can not found MsgType"); } // event message if (WxReceive::MSG_TYPE_EVENT == $data['MsgType']) { $parser = new Ev...
[ "public", "function", "load", "(", "$", "xmlString", ")", "{", "$", "data", "=", "$", "this", "->", "parserXml", "(", "$", "xmlString", ")", ";", "if", "(", "!", "isset", "(", "$", "data", "[", "'MsgType'", "]", ")", ")", "{", "throw", "new", "\\...
parse xml string which come from WeChat server to WxReceiveMsg or WxReceiveEvent @param $xmlString @return WxReceive
[ "parse", "xml", "string", "which", "come", "from", "WeChat", "server", "to", "WxReceiveMsg", "or", "WxReceiveEvent" ]
e7854a193c4d23cc9b84afa465f4706c09e7e7c5
https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/XmlParser.php#L12-L29
3,449
flavorzyb/wechat
src/XmlParser.php
XmlParser.parserXml
protected function parserXml($xmlString) { libxml_disable_entity_loader(true); return json_decode(json_encode(simplexml_load_string($xmlString,'SimpleXMLElement', LIBXML_NOCDATA), true), true); }
php
protected function parserXml($xmlString) { libxml_disable_entity_loader(true); return json_decode(json_encode(simplexml_load_string($xmlString,'SimpleXMLElement', LIBXML_NOCDATA), true), true); }
[ "protected", "function", "parserXml", "(", "$", "xmlString", ")", "{", "libxml_disable_entity_loader", "(", "true", ")", ";", "return", "json_decode", "(", "json_encode", "(", "simplexml_load_string", "(", "$", "xmlString", ",", "'SimpleXMLElement'", ",", "LIBXML_NO...
parse xml to array @param $xmlString @return array
[ "parse", "xml", "to", "array" ]
e7854a193c4d23cc9b84afa465f4706c09e7e7c5
https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/XmlParser.php#L37-L41
3,450
jhorlima/wp-mocabonita
src/view/MbView.php
MbView.getAttribute
public function getAttribute($name = null) { return is_null($name) ? $this->attributes : Arr::get($this->attributes, $name); }
php
public function getAttribute($name = null) { return is_null($name) ? $this->attributes : Arr::get($this->attributes, $name); }
[ "public", "function", "getAttribute", "(", "$", "name", "=", "null", ")", "{", "return", "is_null", "(", "$", "name", ")", "?", "$", "this", "->", "attributes", ":", "Arr", "::", "get", "(", "$", "this", "->", "attributes", ",", "$", "name", ")", "...
Get variables for view @param null $name @return mixed[]
[ "Get", "variables", "for", "view" ]
a864b40d5452bc9b892f02a6bb28c02639f25fa8
https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/view/MbView.php#L363-L366
3,451
jhorlima/wp-mocabonita
src/view/MbView.php
MbView.setView
public function setView($templateName, $page, $action, array $attributes = [], $extension = "phtml") { $this->setTemplate($templateName); $this->setPage($page); $this->setAction($action); $this->setAttributes($attributes); $this->setExtension($extension); return $thi...
php
public function setView($templateName, $page, $action, array $attributes = [], $extension = "phtml") { $this->setTemplate($templateName); $this->setPage($page); $this->setAction($action); $this->setAttributes($attributes); $this->setExtension($extension); return $thi...
[ "public", "function", "setView", "(", "$", "templateName", ",", "$", "page", ",", "$", "action", ",", "array", "$", "attributes", "=", "[", "]", ",", "$", "extension", "=", "\"phtml\"", ")", "{", "$", "this", "->", "setTemplate", "(", "$", "templateNam...
Set parameters for view @param string $templateName @param string $page @param string $action @param array $attributes @param string $extension @return MbView
[ "Set", "parameters", "for", "view" ]
a864b40d5452bc9b892f02a6bb28c02639f25fa8
https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/view/MbView.php#L528-L537
3,452
jhorlima/wp-mocabonita
src/view/MbView.php
MbView.piece
public function piece($filePiece) { $filePiece = $this->viewPath . "{$filePiece}.{$this->extension}"; if (file_exists($filePiece)) { include $filePiece; } else { MbException::registerError(new \Exception("The file {$filePiece} not found!")); } }
php
public function piece($filePiece) { $filePiece = $this->viewPath . "{$filePiece}.{$this->extension}"; if (file_exists($filePiece)) { include $filePiece; } else { MbException::registerError(new \Exception("The file {$filePiece} not found!")); } }
[ "public", "function", "piece", "(", "$", "filePiece", ")", "{", "$", "filePiece", "=", "$", "this", "->", "viewPath", ".", "\"{$filePiece}.{$this->extension}\"", ";", "if", "(", "file_exists", "(", "$", "filePiece", ")", ")", "{", "include", "$", "filePiece"...
Get a piece to include in the view @param string $filePiece File part address @return void
[ "Get", "a", "piece", "to", "include", "in", "the", "view" ]
a864b40d5452bc9b892f02a6bb28c02639f25fa8
https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/view/MbView.php#L562-L571
3,453
artkonekt/sylius-sync-bundle
Model/Translation/TranslatableTrait.php
TranslatableTrait.getTranslation
public function getTranslation($lang, $create = false) { foreach ($this->translations as $translation) { if ($lang == $translation->getLang()) { return $translation; } } if ($create) { $class = $this->getTranslationClass(); /*...
php
public function getTranslation($lang, $create = false) { foreach ($this->translations as $translation) { if ($lang == $translation->getLang()) { return $translation; } } if ($create) { $class = $this->getTranslationClass(); /*...
[ "public", "function", "getTranslation", "(", "$", "lang", ",", "$", "create", "=", "false", ")", "{", "foreach", "(", "$", "this", "->", "translations", "as", "$", "translation", ")", "{", "if", "(", "$", "lang", "==", "$", "translation", "->", "getLan...
Returns the translation in a given language @param string $lang The language code (eg. 'en') @param bool $create Whether or not to create if it doesn't exists @return TranslationInterface|null
[ "Returns", "the", "translation", "in", "a", "given", "language" ]
fe2864c648971fc058994d8554549061a3a2a0c0
https://github.com/artkonekt/sylius-sync-bundle/blob/fe2864c648971fc058994d8554549061a3a2a0c0/Model/Translation/TranslatableTrait.php#L47-L67
3,454
colorium/runtime
src/Colorium/Runtime/Resolver.php
Resolver.ofStaticMethod
public static function ofStaticMethod($callable) { // parse class::method to [class, method] if(is_string($callable) and strpos($callable, '::') !== false) { $callable = explode('::', $callable); } // resolve [class, method] if(is_array($callable) and count($call...
php
public static function ofStaticMethod($callable) { // parse class::method to [class, method] if(is_string($callable) and strpos($callable, '::') !== false) { $callable = explode('::', $callable); } // resolve [class, method] if(is_array($callable) and count($call...
[ "public", "static", "function", "ofStaticMethod", "(", "$", "callable", ")", "{", "// parse class::method to [class, method]", "if", "(", "is_string", "(", "$", "callable", ")", "and", "strpos", "(", "$", "callable", ",", "'::'", ")", "!==", "false", ")", "{",...
Resolve if callable is static method @param $callable @return Invokable
[ "Resolve", "if", "callable", "is", "static", "method" ]
8905bb7370aa6aa5c89494aa020a2922d8feb32d
https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Resolver.php#L14-L32
3,455
colorium/runtime
src/Colorium/Runtime/Resolver.php
Resolver.ofClassMethod
public static function ofClassMethod($callable) { // parse class::method to [class, method] if(is_string($callable) and strpos($callable, '::') !== false) { $callable = explode('::', $callable); } // resolve [class, method] if(is_array($callable) and count($calla...
php
public static function ofClassMethod($callable) { // parse class::method to [class, method] if(is_string($callable) and strpos($callable, '::') !== false) { $callable = explode('::', $callable); } // resolve [class, method] if(is_array($callable) and count($calla...
[ "public", "static", "function", "ofClassMethod", "(", "$", "callable", ")", "{", "// parse class::method to [class, method]", "if", "(", "is_string", "(", "$", "callable", ")", "and", "strpos", "(", "$", "callable", ",", "'::'", ")", "!==", "false", ")", "{", ...
Resolve if callable is class method @param $callable @return Invokable
[ "Resolve", "if", "callable", "is", "class", "method" ]
8905bb7370aa6aa5c89494aa020a2922d8feb32d
https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Resolver.php#L41-L59
3,456
colorium/runtime
src/Colorium/Runtime/Resolver.php
Resolver.ofFunction
public static function ofFunction($callable) { if($callable instanceof \Closure or (is_string($callable) and function_exists($callable))) { $annotations = Annotation::ofFunction($callable); $reflector = new \ReflectionFunction($callable); return new Invokable($callable, I...
php
public static function ofFunction($callable) { if($callable instanceof \Closure or (is_string($callable) and function_exists($callable))) { $annotations = Annotation::ofFunction($callable); $reflector = new \ReflectionFunction($callable); return new Invokable($callable, I...
[ "public", "static", "function", "ofFunction", "(", "$", "callable", ")", "{", "if", "(", "$", "callable", "instanceof", "\\", "Closure", "or", "(", "is_string", "(", "$", "callable", ")", "and", "function_exists", "(", "$", "callable", ")", ")", ")", "{"...
Resolve if callable is closure or function @param $callable @return Invokable
[ "Resolve", "if", "callable", "is", "closure", "or", "function" ]
8905bb7370aa6aa5c89494aa020a2922d8feb32d
https://github.com/colorium/runtime/blob/8905bb7370aa6aa5c89494aa020a2922d8feb32d/src/Colorium/Runtime/Resolver.php#L82-L89
3,457
Opifer/ContentBundle
Model/Content.php
Content.replaceMissingAttributes
public function replaceMissingAttributes() { // collect persisted attributevalues $persistedAttributes = array(); foreach ($this->getValueSet()->getValues() as $value) { $persistedAttributes[] = $value->getAttribute(); } $newValues = array(); // Create em...
php
public function replaceMissingAttributes() { // collect persisted attributevalues $persistedAttributes = array(); foreach ($this->getValueSet()->getValues() as $value) { $persistedAttributes[] = $value->getAttribute(); } $newValues = array(); // Create em...
[ "public", "function", "replaceMissingAttributes", "(", ")", "{", "// collect persisted attributevalues", "$", "persistedAttributes", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getValueSet", "(", ")", "->", "getValues", "(", ")", "as", "$", ...
Creates fake values for non-persisted attributes @return array new Values which can be persisted through an EntityManager
[ "Creates", "fake", "values", "for", "non", "-", "persisted", "attributes" ]
df44ef36b81a839ce87ea9a92f7728618111541f
https://github.com/Opifer/ContentBundle/blob/df44ef36b81a839ce87ea9a92f7728618111541f/Model/Content.php#L709-L732
3,458
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.getDirectoryParts
public function getDirectoryParts(): array { return $this->myAboveBaseLevel === 0 ? $this->myDirectoryParts : array_merge(array_fill(0, $this->myAboveBaseLevel, '..'), $this->myDirectoryParts); }
php
public function getDirectoryParts(): array { return $this->myAboveBaseLevel === 0 ? $this->myDirectoryParts : array_merge(array_fill(0, $this->myAboveBaseLevel, '..'), $this->myDirectoryParts); }
[ "public", "function", "getDirectoryParts", "(", ")", ":", "array", "{", "return", "$", "this", "->", "myAboveBaseLevel", "===", "0", "?", "$", "this", "->", "myDirectoryParts", ":", "array_merge", "(", "array_fill", "(", "0", ",", "$", "this", "->", "myAbo...
Returns the directory parts. @since 1.0.0 @return string[] The directory parts.
[ "Returns", "the", "directory", "parts", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L39-L42
3,459
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myToString
private function myToString(string $directorySeparator, ?callable $stringEncoder = null): string { return $this->myDirectoryToString($directorySeparator, $stringEncoder) . $this->myFilenameToString($stringEncoder); }
php
private function myToString(string $directorySeparator, ?callable $stringEncoder = null): string { return $this->myDirectoryToString($directorySeparator, $stringEncoder) . $this->myFilenameToString($stringEncoder); }
[ "private", "function", "myToString", "(", "string", "$", "directorySeparator", ",", "?", "callable", "$", "stringEncoder", "=", "null", ")", ":", "string", "{", "return", "$", "this", "->", "myDirectoryToString", "(", "$", "directorySeparator", ",", "$", "stri...
Returns the path as a string. @param string $directorySeparator The directory separator. @param callable|null $stringEncoder The string encoding function or null if parts should not be encoded. @return string The path as a string.
[ "Returns", "the", "path", "as", "a", "string", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L124-L127
3,460
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myDirectoryToString
private function myDirectoryToString(string $directorySeparator, ?callable $stringEncoder = null): string { $result = ''; if ($this->myAboveBaseLevel > 0) { $result .= str_repeat('..' . $directorySeparator, $this->myAboveBaseLevel); } if ($this->myIsAbsolute) { ...
php
private function myDirectoryToString(string $directorySeparator, ?callable $stringEncoder = null): string { $result = ''; if ($this->myAboveBaseLevel > 0) { $result .= str_repeat('..' . $directorySeparator, $this->myAboveBaseLevel); } if ($this->myIsAbsolute) { ...
[ "private", "function", "myDirectoryToString", "(", "string", "$", "directorySeparator", ",", "?", "callable", "$", "stringEncoder", "=", "null", ")", ":", "string", "{", "$", "result", "=", "''", ";", "if", "(", "$", "this", "->", "myAboveBaseLevel", ">", ...
Returns the directory as a string. @param string $directorySeparator The directory separator. @param callable|null $stringEncoder The string encoding function or null if parts should not be encoded. @return string The directory as a string.
[ "Returns", "the", "directory", "as", "a", "string", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L137-L158
3,461
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myFilenameToString
private function myFilenameToString(?callable $stringEncoder = null): string { if ($this->myFilename === null) { return ''; } if ($stringEncoder !== null) { return $stringEncoder($this->myFilename); } return $this->myFilename; }
php
private function myFilenameToString(?callable $stringEncoder = null): string { if ($this->myFilename === null) { return ''; } if ($stringEncoder !== null) { return $stringEncoder($this->myFilename); } return $this->myFilename; }
[ "private", "function", "myFilenameToString", "(", "?", "callable", "$", "stringEncoder", "=", "null", ")", ":", "string", "{", "if", "(", "$", "this", "->", "myFilename", "===", "null", ")", "{", "return", "''", ";", "}", "if", "(", "$", "stringEncoder",...
Returns the filename as a string. @param callable|null $stringEncoder The string encoding function or null if parts should not be encoded. @return string The filename as a string.
[ "Returns", "the", "filename", "as", "a", "string", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L167-L178
3,462
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myCombine
private function myCombine(PathTraitInterface $other, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { // If other path is absolute, current path is overridden. if ($other->isAbsolute()) { ...
php
private function myCombine(PathTraitInterface $other, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { // If other path is absolute, current path is overridden. if ($other->isAbsolute()) { ...
[ "private", "function", "myCombine", "(", "PathTraitInterface", "$", "other", ",", "?", "bool", "&", "$", "isAbsolute", "=", "null", ",", "?", "int", "&", "$", "aboveBaseLevel", "=", "null", ",", "?", "array", "&", "$", "directoryParts", "=", "null", ",",...
Tries to combine this path with another path. @param PathTraitInterface $other The other path. @param bool|null $isAbsolute Whether the path is absolute or relative is combining was successful, undefined otherwise. @param int|null $aboveBaseLevel The number of directory parts above base...
[ "Tries", "to", "combine", "this", "path", "with", "another", "path", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L192-L216
3,463
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myCombineDirectoryPart
private function myCombineDirectoryPart(string $part, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$error = null): bool { if ($part === '..') { if (count($directoryParts) === 0) { if ($this->myIsAbsolute) { $error = 'Absolute path is ...
php
private function myCombineDirectoryPart(string $part, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$error = null): bool { if ($part === '..') { if (count($directoryParts) === 0) { if ($this->myIsAbsolute) { $error = 'Absolute path is ...
[ "private", "function", "myCombineDirectoryPart", "(", "string", "$", "part", ",", "?", "int", "&", "$", "aboveBaseLevel", "=", "null", ",", "?", "array", "&", "$", "directoryParts", "=", "null", ",", "?", "string", "&", "$", "error", "=", "null", ")", ...
Tries to combine a directory part with another path. @param string $part The part. @param int|null $aboveBaseLevel The number of directory parts above base level if combining was successful, undefined otherwise. @param string[]|null $directoryParts The directory parts if combining was successful,...
[ "Tries", "to", "combine", "a", "directory", "part", "with", "another", "path", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L228-L251
3,464
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myParentDirectory
private function myParentDirectory(?int &$aboveBaseLevel = null, ?array &$directoryParts = null): bool { if (count($this->myDirectoryParts) > 0) { $aboveBaseLevel = $this->myAboveBaseLevel; $directoryParts = array_slice($this->myDirectoryParts, 0, -1); return true; ...
php
private function myParentDirectory(?int &$aboveBaseLevel = null, ?array &$directoryParts = null): bool { if (count($this->myDirectoryParts) > 0) { $aboveBaseLevel = $this->myAboveBaseLevel; $directoryParts = array_slice($this->myDirectoryParts, 0, -1); return true; ...
[ "private", "function", "myParentDirectory", "(", "?", "int", "&", "$", "aboveBaseLevel", "=", "null", ",", "?", "array", "&", "$", "directoryParts", "=", "null", ")", ":", "bool", "{", "if", "(", "count", "(", "$", "this", "->", "myDirectoryParts", ")", ...
Tries to calculate the parent directory for this path and return the result. @param int|null $aboveBaseLevel The number of directory parts above base level if parsing was successful, undefined otherwise. @param string[]|null $directoryParts The directory parts if parsing was successful, undefined otherwise. @ret...
[ "Tries", "to", "calculate", "the", "parent", "directory", "for", "this", "path", "and", "return", "the", "result", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L261-L278
3,465
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myParse
private static function myParse(string $directorySeparator, string $path, callable $partValidator, ?callable $stringDecoder = null, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { $parts = explode($directoryS...
php
private static function myParse(string $directorySeparator, string $path, callable $partValidator, ?callable $stringDecoder = null, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { $parts = explode($directoryS...
[ "private", "static", "function", "myParse", "(", "string", "$", "directorySeparator", ",", "string", "$", "path", ",", "callable", "$", "partValidator", ",", "?", "callable", "$", "stringDecoder", "=", "null", ",", "?", "bool", "&", "$", "isAbsolute", "=", ...
Tries to parse a path and returns the result or error text. @param string $directorySeparator The directory separator. @param string $path The path. @param callable $partValidator The part validator. @param callable|null $stringDecoder The string decoding function or null if ...
[ "Tries", "to", "parse", "a", "path", "and", "returns", "the", "result", "or", "error", "text", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L295-L320
3,466
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myParsePart
private static function myParsePart(string $part, bool $isLastPart, callable $partValidator, ?callable $stringDecoder, ?bool $isAbsolute, ?int &$aboveBaseLevel, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { // Skip empty and current directory parts. if ($...
php
private static function myParsePart(string $part, bool $isLastPart, callable $partValidator, ?callable $stringDecoder, ?bool $isAbsolute, ?int &$aboveBaseLevel, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool { // Skip empty and current directory parts. if ($...
[ "private", "static", "function", "myParsePart", "(", "string", "$", "part", ",", "bool", "$", "isLastPart", ",", "callable", "$", "partValidator", ",", "?", "callable", "$", "stringDecoder", ",", "?", "bool", "$", "isAbsolute", ",", "?", "int", "&", "$", ...
Tries to parse a part of a path and returns the result or error text. @param string $part The part of the path. @param bool $isLastPart True if this is the last part, false otherwise. @param callable $partValidator The part validator. @param callable|null $stringDecoder The string ...
[ "Tries", "to", "parse", "a", "part", "of", "a", "path", "and", "returns", "the", "result", "or", "error", "text", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L337-L356
3,467
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myHandleParentDirectoryPart
private static function myHandleParentDirectoryPart(bool $isAbsolute, int &$aboveBaseLevel, array &$directoryParts, ?string &$error = null): bool { if (count($directoryParts) > 0) { array_pop($directoryParts); return true; } if ($isAbsolute) { $error = '...
php
private static function myHandleParentDirectoryPart(bool $isAbsolute, int &$aboveBaseLevel, array &$directoryParts, ?string &$error = null): bool { if (count($directoryParts) > 0) { array_pop($directoryParts); return true; } if ($isAbsolute) { $error = '...
[ "private", "static", "function", "myHandleParentDirectoryPart", "(", "bool", "$", "isAbsolute", ",", "int", "&", "$", "aboveBaseLevel", ",", "array", "&", "$", "directoryParts", ",", "?", "string", "&", "$", "error", "=", "null", ")", ":", "bool", "{", "if...
Handles a parent directory part. @param bool $isAbsolute Whether the path is absolute or relative. @param int $aboveBaseLevel The number of directory parts above base level. @param array $directoryParts The directory parts. @param string|null $error The error text if validation was no...
[ "Handles", "a", "parent", "directory", "part", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L368-L385
3,468
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myHandleFilenamePart
private static function myHandleFilenamePart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?string &$filename = null, ?string &$error = null): bool { if (!$partValidator($part, false, $error)) { return false; } if ($stringDecoder !== null) { ...
php
private static function myHandleFilenamePart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?string &$filename = null, ?string &$error = null): bool { if (!$partValidator($part, false, $error)) { return false; } if ($stringDecoder !== null) { ...
[ "private", "static", "function", "myHandleFilenamePart", "(", "string", "$", "part", ",", "callable", "$", "partValidator", ",", "?", "callable", "$", "stringDecoder", "=", "null", ",", "?", "string", "&", "$", "filename", "=", "null", ",", "?", "string", ...
Handles the file name part. @param string $part The file name part. @param callable $partValidator The part validator. @param callable|null $stringDecoder The string decoding function or null if parts should not be decoded. @param string|null $filename The file if parsing was not successful...
[ "Handles", "the", "file", "name", "part", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L398-L411
3,469
themichaelhall/datatypes
src/Traits/PathTrait.php
PathTrait.myHandleDirectoryPart
private static function myHandleDirectoryPart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?array &$directoryParts, ?string &$error = null): bool { if (!$partValidator($part, true, $error)) { return false; } if ($stringDecoder !== null) { $...
php
private static function myHandleDirectoryPart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?array &$directoryParts, ?string &$error = null): bool { if (!$partValidator($part, true, $error)) { return false; } if ($stringDecoder !== null) { $...
[ "private", "static", "function", "myHandleDirectoryPart", "(", "string", "$", "part", ",", "callable", "$", "partValidator", ",", "?", "callable", "$", "stringDecoder", "=", "null", ",", "?", "array", "&", "$", "directoryParts", ",", "?", "string", "&", "$",...
Handles the directory part. @param string $part The file name part. @param callable $partValidator The part validator. @param callable|null $stringDecoder The string decoding function or null if parts should not be decoded. @param array $directoryParts The directory parts. @param string...
[ "Handles", "the", "directory", "part", "." ]
c738fdf4ffca2e613badcb3011dbd5268e4309d8
https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/Traits/PathTrait.php#L424-L437
3,470
lembarek/core
src/Repositories/Repository.php
Repository.create
public function create($inputs) { $record = $this->model->create($inputs); $record->save(); return $record; }
php
public function create($inputs) { $record = $this->model->create($inputs); $record->save(); return $record; }
[ "public", "function", "create", "(", "$", "inputs", ")", "{", "$", "record", "=", "$", "this", "->", "model", "->", "create", "(", "$", "inputs", ")", ";", "$", "record", "->", "save", "(", ")", ";", "return", "$", "record", ";", "}" ]
create a new record @param array $input @return Models
[ "create", "a", "new", "record" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L13-L18
3,471
lembarek/core
src/Repositories/Repository.php
Repository.all
public function all($limit = null) { if($limit){ return $this->model->limit($limit)->get(); } return $this->model->all(); }
php
public function all($limit = null) { if($limit){ return $this->model->limit($limit)->get(); } return $this->model->all(); }
[ "public", "function", "all", "(", "$", "limit", "=", "null", ")", "{", "if", "(", "$", "limit", ")", "{", "return", "$", "this", "->", "model", "->", "limit", "(", "$", "limit", ")", "->", "get", "(", ")", ";", "}", "return", "$", "this", "->",...
get all records in database @param integer $limit @return Model
[ "get", "all", "records", "in", "database" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L26-L33
3,472
lembarek/core
src/Repositories/Repository.php
Repository.allWith
public function allWith($with, $limit = null) { if ($limit) { return $this->model->with($with)->limit($limit)->get(); } return $this->model->with($with)->get(); }
php
public function allWith($with, $limit = null) { if ($limit) { return $this->model->with($with)->limit($limit)->get(); } return $this->model->with($with)->get(); }
[ "public", "function", "allWith", "(", "$", "with", ",", "$", "limit", "=", "null", ")", "{", "if", "(", "$", "limit", ")", "{", "return", "$", "this", "->", "model", "->", "with", "(", "$", "with", ")", "->", "limit", "(", "$", "limit", ")", "-...
get all records in database with withs @param string $with @param integer $limit @return void
[ "get", "all", "records", "in", "database", "with", "withs" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L42-L50
3,473
lembarek/core
src/Repositories/Repository.php
Repository.getForUser
public function getForUser($user_id = null) { if ($user_id) { return $this->model->whereUserId($user_id)->get()->first()->toArray(); } if(auth()->user()){ return $this->model->whereUserId(auth()->user()->id)->first()->toArray(); } return null; }
php
public function getForUser($user_id = null) { if ($user_id) { return $this->model->whereUserId($user_id)->get()->first()->toArray(); } if(auth()->user()){ return $this->model->whereUserId(auth()->user()->id)->first()->toArray(); } return null; }
[ "public", "function", "getForUser", "(", "$", "user_id", "=", "null", ")", "{", "if", "(", "$", "user_id", ")", "{", "return", "$", "this", "->", "model", "->", "whereUserId", "(", "$", "user_id", ")", "->", "get", "(", ")", "->", "first", "(", ")"...
get the columns for a users @param int $user @return Model
[ "get", "the", "columns", "for", "a", "users" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L58-L70
3,474
lembarek/core
src/Repositories/Repository.php
Repository.where
public function where($key, $value=null) { if($value) return $this->model->where($key, $value); if(is_array($key)) return $this->model->where($key); return null; }
php
public function where($key, $value=null) { if($value) return $this->model->where($key, $value); if(is_array($key)) return $this->model->where($key); return null; }
[ "public", "function", "where", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "$", "value", ")", "return", "$", "this", "->", "model", "->", "where", "(", "$", "key", ",", "$", "value", ")", ";", "if", "(", "is_array", "(...
try to simulate the where of Eloquent @param string $key @param string $value @return this
[ "try", "to", "simulate", "the", "where", "of", "Eloquent" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L79-L86
3,475
lembarek/core
src/Repositories/Repository.php
Repository.getPaginatedAndOrdered
public function getPaginatedAndOrdered() { $direction = request()->get('direction'); $orderBy = request()->get('orderby'); $p = config('admin.paginate'); if($orderBy) return $this->orderBy($orderBy, $direction)->paginate($p); return $this->paginate(); }
php
public function getPaginatedAndOrdered() { $direction = request()->get('direction'); $orderBy = request()->get('orderby'); $p = config('admin.paginate'); if($orderBy) return $this->orderBy($orderBy, $direction)->paginate($p); return $this->paginate(); }
[ "public", "function", "getPaginatedAndOrdered", "(", ")", "{", "$", "direction", "=", "request", "(", ")", "->", "get", "(", "'direction'", ")", ";", "$", "orderBy", "=", "request", "(", ")", "->", "get", "(", "'orderby'", ")", ";", "$", "p", "=", "c...
get a record paginated and ordered @return Model
[ "get", "a", "record", "paginated", "and", "ordered" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L164-L174
3,476
lembarek/core
src/Repositories/Repository.php
Repository.update
public function update($id, $key, $value=null) { $model = $this->model->find($id); if (is_array($key)) $model->update($key); else $model->{$key}= $value; $model->save(); }
php
public function update($id, $key, $value=null) { $model = $this->model->find($id); if (is_array($key)) $model->update($key); else $model->{$key}= $value; $model->save(); }
[ "public", "function", "update", "(", "$", "id", ",", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "model", "=", "$", "this", "->", "model", "->", "find", "(", "$", "id", ")", ";", "if", "(", "is_array", "(", "$", "key", ")", ")"...
update the status of the model @param integer $id @param string $key @param string $value @return Model
[ "update", "the", "status", "of", "the", "model" ]
7d325ad9b7a81610a07a2f109306fb91b89ab215
https://github.com/lembarek/core/blob/7d325ad9b7a81610a07a2f109306fb91b89ab215/src/Repositories/Repository.php#L195-L205
3,477
uthando-cms/uthando-mail
src/UthandoMail/Form/Element/MailTransportList.php
MailTransportList.init
public function init() { /* @var $options MailOptions */ $options = $this->getServiceLocator() ->getServiceLocator() ->get(MailOptions::class); $emailAddresses = $options->getAddressList(); $addressList = []; foreach ($emailAddresses as $transport =...
php
public function init() { /* @var $options MailOptions */ $options = $this->getServiceLocator() ->getServiceLocator() ->get(MailOptions::class); $emailAddresses = $options->getAddressList(); $addressList = []; foreach ($emailAddresses as $transport =...
[ "public", "function", "init", "(", ")", "{", "/* @var $options MailOptions */", "$", "options", "=", "$", "this", "->", "getServiceLocator", "(", ")", "->", "getServiceLocator", "(", ")", "->", "get", "(", "MailOptions", "::", "class", ")", ";", "$", "emailA...
Set up value options
[ "Set", "up", "value", "options" ]
fcccca7d880ebdbc120b8a7956a397ed7c905afd
https://github.com/uthando-cms/uthando-mail/blob/fcccca7d880ebdbc120b8a7956a397ed7c905afd/src/UthandoMail/Form/Element/MailTransportList.php#L32-L52
3,478
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.indexAction
public function indexAction($page,$sort,$direction) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => '', )); $breadcumbs->addItem(array( 'title' => 'List', 'rout...
php
public function indexAction($page,$sort,$direction) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => '', )); $breadcumbs->addItem(array( 'title' => 'List', 'rout...
[ "public", "function", "indexAction", "(", "$", "page", ",", "$", "sort", ",", "$", "direction", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", ...
Lists all Language entities. @Route("/",defaults={"page"=1, "sort"="id", "direction"="asc"}, name="admin_language") @Route("/page/{page}/sort/{sort}/direction/{direction}/", defaults={"page"=1, "sort"="id", "direction"="asc"}, name="admin_language_pagination") @Method("GET") @Security("has_role('ROLE_ADMIN')") @Templa...
[ "Lists", "all", "Language", "entities", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L32-L67
3,479
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.searchAction
public function searchAction(Request $request) { $this->get('session')->remove('language_search_session'); if ($request->getMethod() === Request::METHOD_POST) { $form = $this->createForm(new LanguageFormType(),new Language(),array( 'search' => true, )); ...
php
public function searchAction(Request $request) { $this->get('session')->remove('language_search_session'); if ($request->getMethod() === Request::METHOD_POST) { $form = $this->createForm(new LanguageFormType(),new Language(),array( 'search' => true, )); ...
[ "public", "function", "searchAction", "(", "Request", "$", "request", ")", "{", "$", "this", "->", "get", "(", "'session'", ")", "->", "remove", "(", "'language_search_session'", ")", ";", "if", "(", "$", "request", "->", "getMethod", "(", ")", "===", "R...
Search filter Language entities. @Route("/search", name="admin_language_search") @Method({"POST","GET"}) @Security("has_role('ROLE_ADMIN')") @Template()
[ "Search", "filter", "Language", "entities", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L77-L93
3,480
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.newAction
public function newAction() { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'New', 'route' => '', ...
php
public function newAction() { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'New', 'route' => '', ...
[ "public", "function", "newAction", "(", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", "array", "(", "'title'", "=>", "'Language'", ",", "'route'...
Displays a form to create a new Language entity. @Route("/new", name="admin_language_new") @Method("GET") @Security("has_role('ROLE_ADMIN')") @Template()
[ "Displays", "a", "form", "to", "create", "a", "new", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L103-L122
3,481
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.createAction
public function createAction(Request $request) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'New', ...
php
public function createAction(Request $request) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'New', ...
[ "public", "function", "createAction", "(", "Request", "$", "request", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", "array", "(", "'title'", "=>...
Creates a new Language entity. @Route("/", name="admin_language_create") @Method("POST") @Security("has_role('ROLE_ADMIN')") @Template("BaconLanguageBundle:Backend/Language:new.html.twig")
[ "Creates", "a", "new", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L131-L161
3,482
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.editAction
public function editAction($id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Edit', 'route' => ...
php
public function editAction($id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Edit', 'route' => ...
[ "public", "function", "editAction", "(", "$", "id", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", "array", "(", "'title'", "=>", "'Language'", ...
Displays a form to edit an existing Language entity. @Route("/{id}/edit", name="admin_language_edit") @Method("GET") @Security("has_role('ROLE_ADMIN')") @Template()
[ "Displays", "a", "form", "to", "edit", "an", "existing", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L172-L206
3,483
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.updateAction
public function updateAction(Request $request, $id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Edit', ...
php
public function updateAction(Request $request, $id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Edit', ...
[ "public", "function", "updateAction", "(", "Request", "$", "request", ",", "$", "id", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", "array", "...
Edits an existing Language entity. @Route("/{id}", name="admin_language_update") @Method("PUT") @Security("has_role('ROLE_ADMIN')") @Template("BaconLanguageBundle:Backend/Language:edit.html.twig")
[ "Edits", "an", "existing", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L216-L261
3,484
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.showAction
public function showAction($id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Details', 'route' ...
php
public function showAction($id) { $breadcumbs = $this->container->get('bacon_breadcrumbs'); $breadcumbs->addItem(array( 'title' => 'Language', 'route' => 'admin_language', )); $breadcumbs->addItem(array( 'title' => 'Details', 'route' ...
[ "public", "function", "showAction", "(", "$", "id", ")", "{", "$", "breadcumbs", "=", "$", "this", "->", "container", "->", "get", "(", "'bacon_breadcrumbs'", ")", ";", "$", "breadcumbs", "->", "addItem", "(", "array", "(", "'title'", "=>", "'Language'", ...
Finds and displays a Language entity. @Route("/{id}", name="admin_language_show") @Method("GET") @Security("has_role('ROLE_ADMIN')") @Template()
[ "Finds", "and", "displays", "a", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L271-L303
3,485
a2c/BaconLanguageBundle
Controller/Backend/LanguageController.php
LanguageController.deleteAction
public function deleteAction(Request $request, $id) { $handler = new LanguageFormHandler( $this->createDeleteForm(), $request, $this->get('doctrine')->getManager(), $this->get('session')->getFlashBag() ); $entity = $this->getDoctrine()->getR...
php
public function deleteAction(Request $request, $id) { $handler = new LanguageFormHandler( $this->createDeleteForm(), $request, $this->get('doctrine')->getManager(), $this->get('session')->getFlashBag() ); $entity = $this->getDoctrine()->getR...
[ "public", "function", "deleteAction", "(", "Request", "$", "request", ",", "$", "id", ")", "{", "$", "handler", "=", "new", "LanguageFormHandler", "(", "$", "this", "->", "createDeleteForm", "(", ")", ",", "$", "request", ",", "$", "this", "->", "get", ...
Deletes a Language entity. @Route("/{id}", name="admin_language_delete") @Security("has_role('ROLE_ADMIN')") @Method("DELETE")
[ "Deletes", "a", "Language", "entity", "." ]
250a477666786c1471b59a477bb35cd85867e686
https://github.com/a2c/BaconLanguageBundle/blob/250a477666786c1471b59a477bb35cd85867e686/Controller/Backend/LanguageController.php#L311-L329
3,486
vinala/kernel
src/Atomium/Compiler/AtomiumCompileCapture.php
AtomiumCompileCapture.get
protected static function get($script, $openTag) { $data = Strings::splite($script, $openTag); // $output = ''; // for ($i = 1; $i < Collection::count($data); $i++) { $next = Strings::splite($data[$i], self::$endOpenTag); $rest = ''; // ...
php
protected static function get($script, $openTag) { $data = Strings::splite($script, $openTag); // $output = ''; // for ($i = 1; $i < Collection::count($data); $i++) { $next = Strings::splite($data[$i], self::$endOpenTag); $rest = ''; // ...
[ "protected", "static", "function", "get", "(", "$", "script", ",", "$", "openTag", ")", "{", "$", "data", "=", "Strings", "::", "splite", "(", "$", "script", ",", "$", "openTag", ")", ";", "//", "$", "output", "=", "''", ";", "//", "for", "(", "$...
Complie the opening tag. @var string
[ "Complie", "the", "opening", "tag", "." ]
346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a
https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Atomium/Compiler/AtomiumCompileCapture.php#L50-L70
3,487
znframework/package-image
MimeTypeFinder.php
MimeTypeFinder.get
public static function get($file) { $type = str_replace('image/', NULL, Singleton::class('ZN\Helpers\Mime')->type($file)); return $type === 'jpg' ? 'jpeg' : $type; }
php
public static function get($file) { $type = str_replace('image/', NULL, Singleton::class('ZN\Helpers\Mime')->type($file)); return $type === 'jpg' ? 'jpeg' : $type; }
[ "public", "static", "function", "get", "(", "$", "file", ")", "{", "$", "type", "=", "str_replace", "(", "'image/'", ",", "NULL", ",", "Singleton", "::", "class", "(", "'ZN\\Helpers\\Mime'", ")", "->", "type", "(", "$", "file", ")", ")", ";", "return",...
Finder mime type. @param string $file
[ "Finder", "mime", "type", "." ]
a4eee7468e2c8b9334b121bd358ab8acbccf11a2
https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/MimeTypeFinder.php#L21-L26
3,488
ntentan/ntentan
src/Controller.php
Controller.getRedirect
protected function getRedirect() : Redirect { $context = Context::getInstance(); $redirect = new Redirect($context->getUrl($context->getParameter('controller_path'))); return $redirect; }
php
protected function getRedirect() : Redirect { $context = Context::getInstance(); $redirect = new Redirect($context->getUrl($context->getParameter('controller_path'))); return $redirect; }
[ "protected", "function", "getRedirect", "(", ")", ":", "Redirect", "{", "$", "context", "=", "Context", "::", "getInstance", "(", ")", ";", "$", "redirect", "=", "new", "Redirect", "(", "$", "context", "->", "getUrl", "(", "$", "context", "->", "getParam...
Get an instance of the Redirect object that is setup with this controller as its base URL. @return Redirect
[ "Get", "an", "instance", "of", "the", "Redirect", "object", "that", "is", "setup", "with", "this", "controller", "as", "its", "base", "URL", "." ]
a6e89de5999bfafe5be9152bcd51ecfef3e928fb
https://github.com/ntentan/ntentan/blob/a6e89de5999bfafe5be9152bcd51ecfef3e928fb/src/Controller.php#L77-L82
3,489
ntentan/ntentan
src/Controller.php
Controller.getActionUrl
protected function getActionUrl($action) : string { $context = Context::getInstance(); return $context->getUrl($context->getParameter('controller_path') . $action); }
php
protected function getActionUrl($action) : string { $context = Context::getInstance(); return $context->getUrl($context->getParameter('controller_path') . $action); }
[ "protected", "function", "getActionUrl", "(", "$", "action", ")", ":", "string", "{", "$", "context", "=", "Context", "::", "getInstance", "(", ")", ";", "return", "$", "context", "->", "getUrl", "(", "$", "context", "->", "getParameter", "(", "'controller...
Returns a URL to an action in this controller. @param string $action The name of the action @return string A URL to the action
[ "Returns", "a", "URL", "to", "an", "action", "in", "this", "controller", "." ]
a6e89de5999bfafe5be9152bcd51ecfef3e928fb
https://github.com/ntentan/ntentan/blob/a6e89de5999bfafe5be9152bcd51ecfef3e928fb/src/Controller.php#L90-L94
3,490
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.hasStringKeys
public static function hasStringKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_string')) > 0; }
php
public static function hasStringKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_string')) > 0; }
[ "public", "static", "function", "hasStringKeys", "(", "$", "value", ",", "$", "allowEmpty", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "value", ")", "{", ...
Test whether an array contains one or more string keys @param mixed $value @param bool $allowEmpty Should an empty array() return true @return bool
[ "Test", "whether", "an", "array", "contains", "one", "or", "more", "string", "keys" ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L40-L51
3,491
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.hasIntegerKeys
public static function hasIntegerKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_int')) > 0; }
php
public static function hasIntegerKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_int')) > 0; }
[ "public", "static", "function", "hasIntegerKeys", "(", "$", "value", ",", "$", "allowEmpty", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "value", ")", "{", ...
Test whether an array contains one or more integer keys @param mixed $value @param bool $allowEmpty Should an empty array() return true @return bool
[ "Test", "whether", "an", "array", "contains", "one", "or", "more", "integer", "keys" ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L60-L71
3,492
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.hasNumericKeys
public static function hasNumericKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_numeric')) > 0; }
php
public static function hasNumericKeys($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return count(array_filter(array_keys($value), 'is_numeric')) > 0; }
[ "public", "static", "function", "hasNumericKeys", "(", "$", "value", ",", "$", "allowEmpty", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "value", ")", "{", ...
Test whether an array contains one or more numeric keys. A numeric key can be one of the following: - an integer 1, - a string with a number '20' - a string with negative number: '-1000' - a float: 2.2120, -78.150999 - a string with float: '4000.99999', '-10.10' @param mixed $value @param bool $allowEmpty Shou...
[ "Test", "whether", "an", "array", "contains", "one", "or", "more", "numeric", "keys", "." ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L87-L98
3,493
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.isList
public static function isList($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) === $value); }
php
public static function isList($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) === $value); }
[ "public", "static", "function", "isList", "(", "$", "value", ",", "$", "allowEmpty", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "value", ")", "{", "retur...
Test whether an array is a list A list is a collection of values assigned to continuous integer keys starting at 0 and ending at count() - 1. For example: <code> $list = array('a', 'b', 'c', 'd'); $list = array( 0 => 'foo', 1 => 'bar', 2 => array('foo' => 'baz'), ); </code> @param mixed $value @param bool $allowE...
[ "Test", "whether", "an", "array", "is", "a", "list" ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L120-L131
3,494
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.isHashTable
public static function isHashTable($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) !== $value); }
php
public static function isHashTable($value, $allowEmpty = false) { if (!is_array($value)) { return false; } if (!$value) { return $allowEmpty; } return (array_values($value) !== $value); }
[ "public", "static", "function", "isHashTable", "(", "$", "value", ",", "$", "allowEmpty", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "value", ")", "{", "...
Test whether an array is a hash table. An array is a hash table if: 1. Contains one or more non-integer keys, or 2. Integer keys are non-continuous or misaligned (not starting with 0) For example: <code> $hash = array( 'foo' => 15, 'bar' => false, ); $hash = array( 1995 => 'Birth of PHP', 2009 => 'PHP 5.3.0', 2012...
[ "Test", "whether", "an", "array", "is", "a", "hash", "table", "." ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L162-L173
3,495
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.inArray
public static function inArray($needle, array $haystack, $strict = false) { if (!$strict) { if (is_int($needle) || is_float($needle)) { $needle = (string) $needle; } if (is_string($needle)) { foreach ($haystack as &$h) { ...
php
public static function inArray($needle, array $haystack, $strict = false) { if (!$strict) { if (is_int($needle) || is_float($needle)) { $needle = (string) $needle; } if (is_string($needle)) { foreach ($haystack as &$h) { ...
[ "public", "static", "function", "inArray", "(", "$", "needle", ",", "array", "$", "haystack", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "!", "$", "strict", ")", "{", "if", "(", "is_int", "(", "$", "needle", ")", "||", "is_float", "(", ...
Checks if a value exists in an array. Due to "foo" == 0 === TRUE with in_array when strict = false, an option has been added to prevent this. When $strict = 0/false, the most secure non-strict check is implemented. if $strict = -1, the default in_array non-strict behaviour is used. @param mixed $needle @param array $...
[ "Checks", "if", "a", "value", "exists", "in", "an", "array", "." ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L188-L203
3,496
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.iteratorToArray
public static function iteratorToArray($iterator, $recursive = true) { if (!is_array($iterator) && !$iterator instanceof Traversable) { throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); } if (!$recursive) { if (is_a...
php
public static function iteratorToArray($iterator, $recursive = true) { if (!is_array($iterator) && !$iterator instanceof Traversable) { throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); } if (!$recursive) { if (is_a...
[ "public", "static", "function", "iteratorToArray", "(", "$", "iterator", ",", "$", "recursive", "=", "true", ")", "{", "if", "(", "!", "is_array", "(", "$", "iterator", ")", "&&", "!", "$", "iterator", "instanceof", "Traversable", ")", "{", "throw", "new...
Convert an iterator to an array. Converts an iterator to an array. The $recursive flag, on by default, hints whether or not you want to do so recursively. @param array|Traversable $iterator The array or Traversable object to convert @param bool $recursive Recursively check all nested structure...
[ "Convert", "an", "iterator", "to", "an", "array", "." ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L216-L255
3,497
anklimsk/cakephp-basic-functions
Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php
ArrayUtils.filter
public static function filter(array $data, $callback, $flag = null) { if (! is_callable($callback)) { throw new Exception\InvalidArgumentException(sprintf( 'Second parameter of %s must be callable', __METHOD__ )); } if (version_compare...
php
public static function filter(array $data, $callback, $flag = null) { if (! is_callable($callback)) { throw new Exception\InvalidArgumentException(sprintf( 'Second parameter of %s must be callable', __METHOD__ )); } if (version_compare...
[ "public", "static", "function", "filter", "(", "array", "$", "data", ",", "$", "callback", ",", "$", "flag", "=", "null", ")", "{", "if", "(", "!", "is_callable", "(", "$", "callback", ")", ")", "{", "throw", "new", "Exception", "\\", "InvalidArgumentE...
Compatibility Method for array_filter on <5.6 systems @param array $data @param callable $callback @param null|int $flag @return array
[ "Compatibility", "Method", "for", "array_filter", "on", "<5", ".", "6", "systems" ]
7554e8b0b420fd3155593af7bf76b7ccbdc8701e
https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-stdlib/src/ArrayUtils.php#L302-L334
3,498
agentmedia/phine-forms
src/Forms/Logic/Tree/RadioListProvider.php
RadioListProvider.TopMost
public function TopMost() { $sql = Access::SqlBuilder(); $tblOption = RadioOption::Schema()->Table(); $where = $sql->Equals($tblOption->Field('RadioField'), $sql->Value($this->radio->GetID())) ->And_($sql->IsNull($tblOption->Field('Previous'))); return RadioO...
php
public function TopMost() { $sql = Access::SqlBuilder(); $tblOption = RadioOption::Schema()->Table(); $where = $sql->Equals($tblOption->Field('RadioField'), $sql->Value($this->radio->GetID())) ->And_($sql->IsNull($tblOption->Field('Previous'))); return RadioO...
[ "public", "function", "TopMost", "(", ")", "{", "$", "sql", "=", "Access", "::", "SqlBuilder", "(", ")", ";", "$", "tblOption", "=", "RadioOption", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "where", "=", "$", "sql", "->", "Equals...
Returns the top most option @return RadioOption
[ "Returns", "the", "top", "most", "option" ]
cd7a92ea443756bef5885a9e8f59ad6b8d2771fc
https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Logic/Tree/RadioListProvider.php#L63-L71
3,499
agentmedia/phine-forms
src/Forms/Logic/Tree/RadioListProvider.php
RadioListProvider.ToArray
public function ToArray() { $result = array(); $option = $this->TopMost(); while ($option) { $result[$option->GetValue()] = $option->GetText(); $option = $this->NextOf($option); } return $result; }
php
public function ToArray() { $result = array(); $option = $this->TopMost(); while ($option) { $result[$option->GetValue()] = $option->GetText(); $option = $this->NextOf($option); } return $result; }
[ "public", "function", "ToArray", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "option", "=", "$", "this", "->", "TopMost", "(", ")", ";", "while", "(", "$", "option", ")", "{", "$", "result", "[", "$", "option", "->", "GetValue...
Gets the radio options as array @return array Returns the options as associative value=>text array
[ "Gets", "the", "radio", "options", "as", "array" ]
cd7a92ea443756bef5885a9e8f59ad6b8d2771fc
https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Logic/Tree/RadioListProvider.php#L77-L87