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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26,700 | iherwig/wcmf | src/wcmf/lib/io/impl/FileCache.php | FileCache.initializeCache | private function initializeCache($section) {
if (!isset($this->cache[$section])) {
$file = $this->getCacheFile($section);
if (file_exists($file)) {
$this->cache[$section] = unserialize(file_get_contents($file));
}
else {
$this->cache[$section] = [];
}
}
} | php | private function initializeCache($section) {
if (!isset($this->cache[$section])) {
$file = $this->getCacheFile($section);
if (file_exists($file)) {
$this->cache[$section] = unserialize(file_get_contents($file));
}
else {
$this->cache[$section] = [];
}
}
} | [
"private",
"function",
"initializeCache",
"(",
"$",
"section",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"section",
"]",
")",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
"$",
"section",
")... | Initialize the cache
@param $section The caching section | [
"Initialize",
"the",
"cache"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/impl/FileCache.php#L134-L144 |
26,701 | iherwig/wcmf | src/wcmf/lib/io/impl/FileCache.php | FileCache.isExpired | private function isExpired($createTs, $lifetime) {
if ($lifetime === null) {
return false;
}
$expireDate = (new \DateTime())->setTimeStamp($createTs);
if (intval($lifetime)) {
$expireDate = $expireDate->modify('+'.$lifetime.' seconds');
}
return $expireDate < new \DateTime();
} | php | private function isExpired($createTs, $lifetime) {
if ($lifetime === null) {
return false;
}
$expireDate = (new \DateTime())->setTimeStamp($createTs);
if (intval($lifetime)) {
$expireDate = $expireDate->modify('+'.$lifetime.' seconds');
}
return $expireDate < new \DateTime();
} | [
"private",
"function",
"isExpired",
"(",
"$",
"createTs",
",",
"$",
"lifetime",
")",
"{",
"if",
"(",
"$",
"lifetime",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"expireDate",
"=",
"(",
"new",
"\\",
"DateTime",
"(",
")",
")",
"->",
"... | Check if an entry with the given creation timestamp and lifetime is expired
@param $createTs The creation timestamp
@param $lifetime The lifetime in seconds
@return Boolean | [
"Check",
"if",
"an",
"entry",
"with",
"the",
"given",
"creation",
"timestamp",
"and",
"lifetime",
"is",
"expired"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/impl/FileCache.php#L152-L161 |
26,702 | iherwig/wcmf | src/wcmf/lib/io/impl/FileCache.php | FileCache.saveCache | private function saveCache($section) {
$content = serialize($this->cache[$section]);
$file = $this->getCacheFile($section);
$this->fileUtil->mkdirRec(dirname($file));
$fh = fopen($file, "w");
if ($fh !== false) {
fwrite($fh, $content);
fclose($fh);
}
else {
throw new Config... | php | private function saveCache($section) {
$content = serialize($this->cache[$section]);
$file = $this->getCacheFile($section);
$this->fileUtil->mkdirRec(dirname($file));
$fh = fopen($file, "w");
if ($fh !== false) {
fwrite($fh, $content);
fclose($fh);
}
else {
throw new Config... | [
"private",
"function",
"saveCache",
"(",
"$",
"section",
")",
"{",
"$",
"content",
"=",
"serialize",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"section",
"]",
")",
";",
"$",
"file",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
"$",
"section",
")",
... | Save the cache
@param $section The caching section | [
"Save",
"the",
"cache"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/impl/FileCache.php#L167-L179 |
26,703 | iherwig/wcmf | src/wcmf/lib/persistence/Criteria.php | Criteria.getId | public function getId() {
$str = "[".$this->combineOperator."] ".$this->type.".".$this->attribute.
" ".$this->operator.(is_array($this->value) ? sizeof($this->value) : "");
return $str;
} | php | public function getId() {
$str = "[".$this->combineOperator."] ".$this->type.".".$this->attribute.
" ".$this->operator.(is_array($this->value) ? sizeof($this->value) : "");
return $str;
} | [
"public",
"function",
"getId",
"(",
")",
"{",
"$",
"str",
"=",
"\"[\"",
".",
"$",
"this",
"->",
"combineOperator",
".",
"\"] \"",
".",
"$",
"this",
"->",
"type",
".",
"\".\"",
".",
"$",
"this",
"->",
"attribute",
".",
"\" \"",
".",
"$",
"this",
"->... | Get an identifier for the instance
@return String | [
"Get",
"an",
"identifier",
"for",
"the",
"instance"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/Criteria.php#L148-L152 |
26,704 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.doMoveBefore | protected function doMoveBefore() {
$request = $this->getRequest();
$persistenceFacade = $this->getPersistenceFacade();
$isOrderBottom = $this->isOrderBotton($request);
// load the moved object and the reference object
$insertOid = ObjectId::parse($request->getValue('insertOid'));
$referenceOid... | php | protected function doMoveBefore() {
$request = $this->getRequest();
$persistenceFacade = $this->getPersistenceFacade();
$isOrderBottom = $this->isOrderBotton($request);
// load the moved object and the reference object
$insertOid = ObjectId::parse($request->getValue('insertOid'));
$referenceOid... | [
"protected",
"function",
"doMoveBefore",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"$",
"isOrderBottom",
"=",
"$",
"this",
... | Execute the moveBefore action | [
"Execute",
"the",
"moveBefore",
"action"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L154-L192 |
26,705 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.doInsertBefore | protected function doInsertBefore() {
$request = $this->getRequest();
$persistenceFacade = $this->getPersistenceFacade();
$isOrderBottom = $this->isOrderBotton($request);
// load the moved object, the reference object and the conainer object
$insertOid = ObjectId::parse($request->getValue('insertOi... | php | protected function doInsertBefore() {
$request = $this->getRequest();
$persistenceFacade = $this->getPersistenceFacade();
$isOrderBottom = $this->isOrderBotton($request);
// load the moved object, the reference object and the conainer object
$insertOid = ObjectId::parse($request->getValue('insertOi... | [
"protected",
"function",
"doInsertBefore",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"$",
"isOrderBottom",
"=",
"$",
"this",
... | Execute the insertBefore action | [
"Execute",
"the",
"insertBefore",
"action"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L197-L240 |
26,706 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.loadPreviousObject | protected function loadPreviousObject($type, $sortkeyName, $sortkeyValue, $sortDirection) {
$query = new ObjectQuery($type);
$tpl = $query->getObjectTemplate($type);
$tpl->setValue($sortkeyName, Criteria::asValue($sortDirection == 'ASC' ? '<' : '>', $sortkeyValue), true);
$pagingInfo = new PagingInfo(1,... | php | protected function loadPreviousObject($type, $sortkeyName, $sortkeyValue, $sortDirection) {
$query = new ObjectQuery($type);
$tpl = $query->getObjectTemplate($type);
$tpl->setValue($sortkeyName, Criteria::asValue($sortDirection == 'ASC' ? '<' : '>', $sortkeyValue), true);
$pagingInfo = new PagingInfo(1,... | [
"protected",
"function",
"loadPreviousObject",
"(",
"$",
"type",
",",
"$",
"sortkeyName",
",",
"$",
"sortkeyValue",
",",
"$",
"sortDirection",
")",
"{",
"$",
"query",
"=",
"new",
"ObjectQuery",
"(",
"$",
"type",
")",
";",
"$",
"tpl",
"=",
"$",
"query",
... | Load the object which order position is before the given sort value
@param $type The type of objects
@param $sortkeyName The name of the sortkey attribute
@param $sortkeyValue The reference sortkey value
@param $sortDirection The sort direction used with the sort key | [
"Load",
"the",
"object",
"which",
"order",
"position",
"is",
"before",
"the",
"given",
"sort",
"value"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L249-L256 |
26,707 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.loadLastObject | protected function loadLastObject($type, $sortkeyName, $sortDirection) {
$query = new ObjectQuery($type);
$pagingInfo = new PagingInfo(1, true);
$invSortDir = $sortDirection == 'ASC' ? 'DESC' : 'ASC';
$objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".$invSortDir], $pagingInfo);
return... | php | protected function loadLastObject($type, $sortkeyName, $sortDirection) {
$query = new ObjectQuery($type);
$pagingInfo = new PagingInfo(1, true);
$invSortDir = $sortDirection == 'ASC' ? 'DESC' : 'ASC';
$objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".$invSortDir], $pagingInfo);
return... | [
"protected",
"function",
"loadLastObject",
"(",
"$",
"type",
",",
"$",
"sortkeyName",
",",
"$",
"sortDirection",
")",
"{",
"$",
"query",
"=",
"new",
"ObjectQuery",
"(",
"$",
"type",
")",
";",
"$",
"pagingInfo",
"=",
"new",
"PagingInfo",
"(",
"1",
",",
... | Load the last object regarding the given sort key
@param $type The type of objects
@param $sortkeyName The name of the sortkey attribute
@param $sortDirection The sort direction used with the sort key | [
"Load",
"the",
"last",
"object",
"regarding",
"the",
"given",
"sort",
"key"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L264-L270 |
26,708 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.checkObjects | protected function checkObjects($objectMap) {
$response = $this->getResponse();
$invalidOids = [];
foreach ($objectMap as $parameterName => $object) {
if ($object == null) {
$invalidOids[] = $parameterName;
}
}
if (sizeof($invalidOids) > 0) {
$response->addError(Application... | php | protected function checkObjects($objectMap) {
$response = $this->getResponse();
$invalidOids = [];
foreach ($objectMap as $parameterName => $object) {
if ($object == null) {
$invalidOids[] = $parameterName;
}
}
if (sizeof($invalidOids) > 0) {
$response->addError(Application... | [
"protected",
"function",
"checkObjects",
"(",
"$",
"objectMap",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
";",
"$",
"invalidOids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"objectMap",
"as",
"$",
"parameterName",
"=>",
... | Check if all objects in the given array are not null and add
an OID_INVALID error to the response, if at least one is
@param $objectMap An associative array with the controller parameter names
as keys and the objects to check as values
@return Boolean | [
"Check",
"if",
"all",
"objects",
"in",
"the",
"given",
"array",
"are",
"not",
"null",
"and",
"add",
"an",
"OID_INVALID",
"error",
"to",
"the",
"response",
"if",
"at",
"least",
"one",
"is"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L279-L293 |
26,709 | iherwig/wcmf | src/wcmf/application/controller/SortController.php | SortController.getSortkeyValue | protected function getSortkeyValue($object, $valueName) {
$value = $object->getValue($valueName);
if ($value == null) {
$value = $object->getOID()->getFirstId();
}
return $value;
} | php | protected function getSortkeyValue($object, $valueName) {
$value = $object->getValue($valueName);
if ($value == null) {
$value = $object->getOID()->getFirstId();
}
return $value;
} | [
"protected",
"function",
"getSortkeyValue",
"(",
"$",
"object",
",",
"$",
"valueName",
")",
"{",
"$",
"value",
"=",
"$",
"object",
"->",
"getValue",
"(",
"$",
"valueName",
")",
";",
"if",
"(",
"$",
"value",
"==",
"null",
")",
"{",
"$",
"value",
"=",
... | Get the sortkey value of an object. Defaults to the object's id, if
the value is null
@param $object The object
@param $valueName The name of the sortkey attribute
@return String | [
"Get",
"the",
"sortkey",
"value",
"of",
"an",
"object",
".",
"Defaults",
"to",
"the",
"object",
"s",
"id",
"if",
"the",
"value",
"is",
"null"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SortController.php#L311-L317 |
26,710 | iherwig/wcmf | src/wcmf/lib/persistence/ObjectComparator.php | ObjectComparator.compare | public function compare(PersistentObject $a, PersistentObject $b) {
// we compare for each criteria and sum the results for $a, $b
// afterwards we compare the sums and return -1,0,1 appropriate
$sumA = 0;
$sumB = 0;
$maxWeight = sizeOf($this->sortCriteria);
$i = 0;
foreach ($this->sortCrite... | php | public function compare(PersistentObject $a, PersistentObject $b) {
// we compare for each criteria and sum the results for $a, $b
// afterwards we compare the sums and return -1,0,1 appropriate
$sumA = 0;
$sumB = 0;
$maxWeight = sizeOf($this->sortCriteria);
$i = 0;
foreach ($this->sortCrite... | [
"public",
"function",
"compare",
"(",
"PersistentObject",
"$",
"a",
",",
"PersistentObject",
"$",
"b",
")",
"{",
"// we compare for each criteria and sum the results for $a, $b",
"// afterwards we compare the sums and return -1,0,1 appropriate",
"$",
"sumA",
"=",
"0",
";",
"$... | Compare function for sorting PersitentObject instances by the list of criterias
@param $a First PersitentObject instance
@param $b First PersitentObject instance
@return -1, 0 or 1 whether a is less, equal or greater than b
in respect of the criteria | [
"Compare",
"function",
"for",
"sorting",
"PersitentObject",
"instances",
"by",
"the",
"list",
"of",
"criterias"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/ObjectComparator.php#L85-L139 |
26,711 | iherwig/wcmf | src/wcmf/lib/model/visitor/LayoutVisitor.php | LayoutVisitor.calculatePosition | private function calculatePosition($obj) {
$parent = & $obj->getParent();
if (!$parent) {
// start here
$position = new Position(0, 0, 0);
}
else {
$position = new Position(0, 0, 0);
$parentPos = $this->map[$parent->getOID()];
$position->y = $parentPos->y + 1;
$positi... | php | private function calculatePosition($obj) {
$parent = & $obj->getParent();
if (!$parent) {
// start here
$position = new Position(0, 0, 0);
}
else {
$position = new Position(0, 0, 0);
$parentPos = $this->map[$parent->getOID()];
$position->y = $parentPos->y + 1;
$positi... | [
"private",
"function",
"calculatePosition",
"(",
"$",
"obj",
")",
"{",
"$",
"parent",
"=",
"&",
"$",
"obj",
"->",
"getParent",
"(",
")",
";",
"if",
"(",
"!",
"$",
"parent",
")",
"{",
"// start here",
"$",
"position",
"=",
"new",
"Position",
"(",
"0",... | Calculate the object's position using the described algorithm.
@param $obj PersistentObject instance | [
"Calculate",
"the",
"object",
"s",
"position",
"using",
"the",
"described",
"algorithm",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/visitor/LayoutVisitor.php#L75-L116 |
26,712 | iherwig/wcmf | src/wcmf/lib/util/DBUtil.php | DBUtil.executeScript | public static function executeScript($file, $initSection) {
$logger = LogManager::getLogger(__CLASS__);
if (file_exists($file)) {
$logger->info('Executing SQL script '.$file.' ...');
// find init params
$config = ObjectFactory::getInstance('configuration');
if (($connectionParams = $con... | php | public static function executeScript($file, $initSection) {
$logger = LogManager::getLogger(__CLASS__);
if (file_exists($file)) {
$logger->info('Executing SQL script '.$file.' ...');
// find init params
$config = ObjectFactory::getInstance('configuration');
if (($connectionParams = $con... | [
"public",
"static",
"function",
"executeScript",
"(",
"$",
"file",
",",
"$",
"initSection",
")",
"{",
"$",
"logger",
"=",
"LogManager",
"::",
"getLogger",
"(",
"__CLASS__",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"$",
"logg... | Execute a sql script. Execution is done inside a transaction, which is rolled back in case of failure.
@param $file The filename of the sql script
@param $initSection The name of the configuration section that defines the database connection
@return Boolean whether execution succeeded or not. | [
"Execute",
"a",
"sql",
"script",
".",
"Execution",
"is",
"done",
"inside",
"a",
"transaction",
"which",
"is",
"rolled",
"back",
"in",
"case",
"of",
"failure",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DBUtil.php#L88-L136 |
26,713 | iherwig/wcmf | src/wcmf/lib/util/DBUtil.php | DBUtil.createDatabase | public static function createDatabase($name, $server, $user, $password) {
$created = false;
if($name && $server && $user) {
// setup connection
$conn =null;
try {
$conn = new PDO("mysql:host=$server", $user, $password);
}
catch(\Exception $ex) {
throw new Persistence... | php | public static function createDatabase($name, $server, $user, $password) {
$created = false;
if($name && $server && $user) {
// setup connection
$conn =null;
try {
$conn = new PDO("mysql:host=$server", $user, $password);
}
catch(\Exception $ex) {
throw new Persistence... | [
"public",
"static",
"function",
"createDatabase",
"(",
"$",
"name",
",",
"$",
"server",
",",
"$",
"user",
",",
"$",
"password",
")",
"{",
"$",
"created",
"=",
"false",
";",
"if",
"(",
"$",
"name",
"&&",
"$",
"server",
"&&",
"$",
"user",
")",
"{",
... | Crate a database on the server. This works only for MySQL databases.
@param $name The name of the source database
@param $server The name of the database server
@param $user The user name
@param $password The password | [
"Crate",
"a",
"database",
"on",
"the",
"server",
".",
"This",
"works",
"only",
"for",
"MySQL",
"databases",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DBUtil.php#L194-L215 |
26,714 | GW2Treasures/gw2api | src/V2/Pagination/PaginatedEndpoint.php | PaginatedEndpoint.all | public function all() {
$size = $this->maxPageSize();
$firstPageResponse = $this->request( $this->createPaginatedRequestQuery( 0, $size ) );
$header_values = $firstPageResponse->getResponse()->getHeader('X-Result-Total');
$total = array_shift($header_values);
$result = $firstPa... | php | public function all() {
$size = $this->maxPageSize();
$firstPageResponse = $this->request( $this->createPaginatedRequestQuery( 0, $size ) );
$header_values = $firstPageResponse->getResponse()->getHeader('X-Result-Total');
$total = array_shift($header_values);
$result = $firstPa... | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"maxPageSize",
"(",
")",
";",
"$",
"firstPageResponse",
"=",
"$",
"this",
"->",
"request",
"(",
"$",
"this",
"->",
"createPaginatedRequestQuery",
"(",
"0",
",",
"$",
"size... | All entries.
@return array | [
"All",
"entries",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Pagination/PaginatedEndpoint.php#L27-L52 |
26,715 | GW2Treasures/gw2api | src/V2/Pagination/PaginatedEndpoint.php | PaginatedEndpoint.page | public function page( $page, $size = null ) {
if( is_null( $size )) {
$size = $this->maxPageSize();
}
if( $size > $this->maxPageSize() || $size <= 0 ) {
throw new OutOfRangeException('$size has to be between 0 and ' . $this->maxPageSize() . ', was ' . $size );
}
... | php | public function page( $page, $size = null ) {
if( is_null( $size )) {
$size = $this->maxPageSize();
}
if( $size > $this->maxPageSize() || $size <= 0 ) {
throw new OutOfRangeException('$size has to be between 0 and ' . $this->maxPageSize() . ', was ' . $size );
}
... | [
"public",
"function",
"page",
"(",
"$",
"page",
",",
"$",
"size",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"size",
")",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"maxPageSize",
"(",
")",
";",
"}",
"if",
"(",
"$",
"size",
">... | Get a single page.
@param int $page
@param int $size
@return mixed | [
"Get",
"a",
"single",
"page",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Pagination/PaginatedEndpoint.php#L61-L75 |
26,716 | GW2Treasures/gw2api | src/V2/Pagination/PaginatedEndpoint.php | PaginatedEndpoint.batch | public function batch( $parallelRequests = null, callable $callback = null ) {
/** @noinspection PhpParamsInspection */
if( !isset( $callback ) && is_callable( $parallelRequests )) {
$callback = $parallelRequests;
$parallelRequests = null;
}
if( is_null( $paralle... | php | public function batch( $parallelRequests = null, callable $callback = null ) {
/** @noinspection PhpParamsInspection */
if( !isset( $callback ) && is_callable( $parallelRequests )) {
$callback = $parallelRequests;
$parallelRequests = null;
}
if( is_null( $paralle... | [
"public",
"function",
"batch",
"(",
"$",
"parallelRequests",
"=",
"null",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"/** @noinspection PhpParamsInspection */",
"if",
"(",
"!",
"isset",
"(",
"$",
"callback",
")",
"&&",
"is_callable",
"(",
"$",
... | Get all entries in multiple small batches.
@param int|null $parallelRequests [optional]
@param callable $callback
@return void | [
"Get",
"all",
"entries",
"in",
"multiple",
"small",
"batches",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Pagination/PaginatedEndpoint.php#L84-L123 |
26,717 | iherwig/wcmf | src/wcmf/lib/presentation/format/impl/HtmlFormat.php | HtmlFormat.getValueDefFromInputControlName | protected static function getValueDefFromInputControlName($name) {
if (strpos($name, 'value') !== 0) {
return null;
}
$def = [];
$fieldDelimiter = StringUtil::escapeForRegex(self::$inputFieldNameDelimiter);
$pieces = preg_split('/'.$fieldDelimiter.'/', $name);
if (sizeof($pieces) != 4) {
... | php | protected static function getValueDefFromInputControlName($name) {
if (strpos($name, 'value') !== 0) {
return null;
}
$def = [];
$fieldDelimiter = StringUtil::escapeForRegex(self::$inputFieldNameDelimiter);
$pieces = preg_split('/'.$fieldDelimiter.'/', $name);
if (sizeof($pieces) != 4) {
... | [
"protected",
"static",
"function",
"getValueDefFromInputControlName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'value'",
")",
"!==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"def",
"=",
"[",
"]",
";",
"$",
"fiel... | Get the object value definition from a HTML input field name.
@param $name The name of input field in the format value-`language`-`name`-`oid`, where name is the name
of the attribute belonging to the node defined by oid
@return An associative array with keys 'oid', 'language', 'name' or null if the name is not valid | [
"Get",
"the",
"object",
"value",
"definition",
"from",
"a",
"HTML",
"input",
"field",
"name",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/format/impl/HtmlFormat.php#L130-L146 |
26,718 | iherwig/wcmf | src/wcmf/lib/presentation/format/impl/HtmlFormat.php | HtmlFormat.getTemplateFile | protected function getTemplateFile(Response $response) {
if (self::$sharedView == null) {
self::$sharedView = ObjectFactory::getInstance('view');
}
// check if a view template is defined
$viewTpl = self::$sharedView->getTemplate($response->getSender(),
$response->getContext(), $r... | php | protected function getTemplateFile(Response $response) {
if (self::$sharedView == null) {
self::$sharedView = ObjectFactory::getInstance('view');
}
// check if a view template is defined
$viewTpl = self::$sharedView->getTemplate($response->getSender(),
$response->getContext(), $r... | [
"protected",
"function",
"getTemplateFile",
"(",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"sharedView",
"==",
"null",
")",
"{",
"self",
"::",
"$",
"sharedView",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'view'",
")",
";",... | Get the template file for the given response
@param $response | [
"Get",
"the",
"template",
"file",
"for",
"the",
"given",
"response"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/format/impl/HtmlFormat.php#L152-L177 |
26,719 | iherwig/wcmf | src/wcmf/lib/persistence/ObjectId.php | ObjectId.parse | public static function parse($oid) {
// fast checks first
if ($oid instanceof ObjectId) {
return $oid;
}
$oidParts = self::parseOidString($oid);
$type = $oidParts['type'];
$ids = $oidParts['id'];
$prefix = $oidParts['prefix'];
// check the type
if (!ObjectFactory::getInstance... | php | public static function parse($oid) {
// fast checks first
if ($oid instanceof ObjectId) {
return $oid;
}
$oidParts = self::parseOidString($oid);
$type = $oidParts['type'];
$ids = $oidParts['id'];
$prefix = $oidParts['prefix'];
// check the type
if (!ObjectFactory::getInstance... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"oid",
")",
"{",
"// fast checks first",
"if",
"(",
"$",
"oid",
"instanceof",
"ObjectId",
")",
"{",
"return",
"$",
"oid",
";",
"}",
"$",
"oidParts",
"=",
"self",
"::",
"parseOidString",
"(",
"$",
"oid",
... | Parse a serialized object id string into an ObjectId instance.
@param $oid The string
@return ObjectId or null, if the id cannot be parsed | [
"Parse",
"a",
"serialized",
"object",
"id",
"string",
"into",
"an",
"ObjectId",
"instance",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/ObjectId.php#L134-L157 |
26,720 | iherwig/wcmf | src/wcmf/lib/persistence/ObjectId.php | ObjectId.parseOidString | private static function parseOidString($oid) {
if (strlen($oid) == 0) {
return null;
}
$oidParts = preg_split(self::getDelimiterPattern(), $oid);
if (sizeof($oidParts) < 2) {
return null;
}
if (self::$idPattern == null) {
self::$idPattern = '/^[0-9]*$|^'.self::$dummyIdPattern... | php | private static function parseOidString($oid) {
if (strlen($oid) == 0) {
return null;
}
$oidParts = preg_split(self::getDelimiterPattern(), $oid);
if (sizeof($oidParts) < 2) {
return null;
}
if (self::$idPattern == null) {
self::$idPattern = '/^[0-9]*$|^'.self::$dummyIdPattern... | [
"private",
"static",
"function",
"parseOidString",
"(",
"$",
"oid",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"oid",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"oidParts",
"=",
"preg_split",
"(",
"self",
"::",
"getDelimiterPattern",
"(",... | Parse the given object id string into it's parts
@param $oid The string
@return Associative array with keys 'type', 'id', 'prefix' | [
"Parse",
"the",
"given",
"object",
"id",
"string",
"into",
"it",
"s",
"parts"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/ObjectId.php#L164-L204 |
26,721 | iherwig/wcmf | src/wcmf/lib/persistence/ObjectId.php | ObjectId.containsDummyIds | public function containsDummyIds() {
foreach ($this->getId() as $id) {
if (self::isDummyId($id)) {
return true;
}
}
return false;
} | php | public function containsDummyIds() {
foreach ($this->getId() as $id) {
if (self::isDummyId($id)) {
return true;
}
}
return false;
} | [
"public",
"function",
"containsDummyIds",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
"as",
"$",
"id",
")",
"{",
"if",
"(",
"self",
"::",
"isDummyId",
"(",
"$",
"id",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"retur... | Check if this object id contains a dummy id.
@return Boolean | [
"Check",
"if",
"this",
"object",
"id",
"contains",
"a",
"dummy",
"id",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/ObjectId.php#L242-L249 |
26,722 | iherwig/wcmf | src/wcmf/lib/persistence/ObjectId.php | ObjectId.getNumberOfPKs | private static function getNumberOfPKs($type) {
if (!isset(self::$numPkKeys[$type])) {
$numPKs = 1;
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
if ($persistenceFacade->isKnownType($type)) {
$mapper = $persistenceFacade->getMapper($type);
$numPKs = sizeof($... | php | private static function getNumberOfPKs($type) {
if (!isset(self::$numPkKeys[$type])) {
$numPKs = 1;
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
if ($persistenceFacade->isKnownType($type)) {
$mapper = $persistenceFacade->getMapper($type);
$numPKs = sizeof($... | [
"private",
"static",
"function",
"getNumberOfPKs",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"numPkKeys",
"[",
"$",
"type",
"]",
")",
")",
"{",
"$",
"numPKs",
"=",
"1",
";",
"$",
"persistenceFacade",
"=",
"ObjectFac... | Get the number of primary keys a type has.
@param $type The type
@return Integer (1 if the type is unknown) | [
"Get",
"the",
"number",
"of",
"primary",
"keys",
"a",
"type",
"has",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/ObjectId.php#L256-L267 |
26,723 | skie/plum_search | src/View/Helper/SearchHelper.php | SearchHelper.input | public function input(BaseParameter $param, $options = [])
{
$input = $this->_defaultInput($param);
$this->_setValue($input, $param);
$this->_setOptions($input, $param);
$this->_applyAutocompleteOptions($input, $param);
$input = Hash::merge($input, $options);
return ... | php | public function input(BaseParameter $param, $options = [])
{
$input = $this->_defaultInput($param);
$this->_setValue($input, $param);
$this->_setOptions($input, $param);
$this->_applyAutocompleteOptions($input, $param);
$input = Hash::merge($input, $options);
return ... | [
"public",
"function",
"input",
"(",
"BaseParameter",
"$",
"param",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"input",
"=",
"$",
"this",
"->",
"_defaultInput",
"(",
"$",
"param",
")",
";",
"$",
"this",
"->",
"_setValue",
"(",
"$",
"input",
... | Generates input for parameter
@param BaseParameter $param Form parameter.
@param array $options Additional input options.
@return array | [
"Generates",
"input",
"for",
"parameter"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/View/Helper/SearchHelper.php#L64-L73 |
26,724 | skie/plum_search | src/View/Helper/SearchHelper.php | SearchHelper._defaultInput | protected function _defaultInput($param)
{
$input = $param->formInputConfig();
$name = $param->config('name');
$input += [
'type' => 'text',
'required' => false,
'label' => Inflector::humanize(preg_replace('/_id$/', '', $name)),
];
if (!$pa... | php | protected function _defaultInput($param)
{
$input = $param->formInputConfig();
$name = $param->config('name');
$input += [
'type' => 'text',
'required' => false,
'label' => Inflector::humanize(preg_replace('/_id$/', '', $name)),
];
if (!$pa... | [
"protected",
"function",
"_defaultInput",
"(",
"$",
"param",
")",
"{",
"$",
"input",
"=",
"$",
"param",
"->",
"formInputConfig",
"(",
")",
";",
"$",
"name",
"=",
"$",
"param",
"->",
"config",
"(",
"'name'",
")",
";",
"$",
"input",
"+=",
"[",
"'type'"... | Generates default input for parameter
@param BaseParameter $param Form parameter.
@return array | [
"Generates",
"default",
"input",
"for",
"parameter"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/View/Helper/SearchHelper.php#L81-L95 |
26,725 | skie/plum_search | src/View/Helper/SearchHelper.php | SearchHelper._setValue | protected function _setValue(&$input, $param)
{
$value = $param->value();
if (!$param->isEmpty()) {
$input['value'] = $value;
} else {
$input['value'] = '';
}
return $input;
} | php | protected function _setValue(&$input, $param)
{
$value = $param->value();
if (!$param->isEmpty()) {
$input['value'] = $value;
} else {
$input['value'] = '';
}
return $input;
} | [
"protected",
"function",
"_setValue",
"(",
"&",
"$",
"input",
",",
"$",
"param",
")",
"{",
"$",
"value",
"=",
"$",
"param",
"->",
"value",
"(",
")",
";",
"if",
"(",
"!",
"$",
"param",
"->",
"isEmpty",
"(",
")",
")",
"{",
"$",
"input",
"[",
"'va... | Set value for field
@param array $input Field options.
@param BaseParameter $param Form parameter.
@return array | [
"Set",
"value",
"for",
"field"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/View/Helper/SearchHelper.php#L104-L114 |
26,726 | skie/plum_search | src/View/Helper/SearchHelper.php | SearchHelper._setOptions | protected function _setOptions(&$input, $param)
{
if ($param->hasOptions() && !isset($input['empty'])) {
$input['empty'] = true;
}
return $input;
} | php | protected function _setOptions(&$input, $param)
{
if ($param->hasOptions() && !isset($input['empty'])) {
$input['empty'] = true;
}
return $input;
} | [
"protected",
"function",
"_setOptions",
"(",
"&",
"$",
"input",
",",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"param",
"->",
"hasOptions",
"(",
")",
"&&",
"!",
"isset",
"(",
"$",
"input",
"[",
"'empty'",
"]",
")",
")",
"{",
"$",
"input",
"[",
"'em... | Set options for field
@param array $input Field options.
@param BaseParameter $param Form parameter.
@return array | [
"Set",
"options",
"for",
"field"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/View/Helper/SearchHelper.php#L123-L130 |
26,727 | skie/plum_search | src/View/Helper/SearchHelper.php | SearchHelper._applyAutocompleteOptions | protected function _applyAutocompleteOptions(&$input, $param)
{
if ($param instanceof AutocompleteParameter) {
$input['data-url'] = $param->autocompleteUrl();
$input['class'] = 'autocomplete';
$input['data-name'] = $param->config('name');
}
return $input;... | php | protected function _applyAutocompleteOptions(&$input, $param)
{
if ($param instanceof AutocompleteParameter) {
$input['data-url'] = $param->autocompleteUrl();
$input['class'] = 'autocomplete';
$input['data-name'] = $param->config('name');
}
return $input;... | [
"protected",
"function",
"_applyAutocompleteOptions",
"(",
"&",
"$",
"input",
",",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"param",
"instanceof",
"AutocompleteParameter",
")",
"{",
"$",
"input",
"[",
"'data-url'",
"]",
"=",
"$",
"param",
"->",
"autocompleteU... | Set autocomplete settings for field
@param array $input Field options.
@param BaseParameter $param Form parameter.
@return array | [
"Set",
"autocomplete",
"settings",
"for",
"field"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/View/Helper/SearchHelper.php#L139-L148 |
26,728 | iherwig/wcmf | src/wcmf/lib/i18n/impl/DefaultLocalization.php | DefaultLocalization.loadTranslationImpl | protected function loadTranslationImpl(PersistentObject $object, $lang, $useDefaults=true) {
if ($object == null) {
throw new IllegalArgumentException('Cannot load translation for null');
}
$oidStr = $object->getOID()->__toString();
$cacheKey = $oidStr.'.'.$lang.'.'.$useDefaults;
if (!isset(... | php | protected function loadTranslationImpl(PersistentObject $object, $lang, $useDefaults=true) {
if ($object == null) {
throw new IllegalArgumentException('Cannot load translation for null');
}
$oidStr = $object->getOID()->__toString();
$cacheKey = $oidStr.'.'.$lang.'.'.$useDefaults;
if (!isset(... | [
"protected",
"function",
"loadTranslationImpl",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"lang",
",",
"$",
"useDefaults",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"'Can... | Load a translation of a single entity for a specific language.
@param $object PersistentObject instance to load the translation into. The object
is supposed to have it's values in the default language.
@param $lang The language of the translation to load.
@param $useDefaults Boolean whether to use the default language ... | [
"Load",
"a",
"translation",
"of",
"a",
"single",
"entity",
"for",
"a",
"specific",
"language",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/i18n/impl/DefaultLocalization.php#L220-L262 |
26,729 | iherwig/wcmf | src/wcmf/lib/i18n/impl/DefaultLocalization.php | DefaultLocalization.saveTranslationImpl | protected function saveTranslationImpl(PersistentObject $object, $lang) {
// if the requested language is the default language, do nothing
if ($lang == $this->getDefaultLanguage()) {
// nothing to do
}
// save the translations for any other language
else {
$object->beforeUpdate();
... | php | protected function saveTranslationImpl(PersistentObject $object, $lang) {
// if the requested language is the default language, do nothing
if ($lang == $this->getDefaultLanguage()) {
// nothing to do
}
// save the translations for any other language
else {
$object->beforeUpdate();
... | [
"protected",
"function",
"saveTranslationImpl",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"lang",
")",
"{",
"// if the requested language is the default language, do nothing",
"if",
"(",
"$",
"lang",
"==",
"$",
"this",
"->",
"getDefaultLanguage",
"(",
")",
")"... | Save a translation of a single entity for a specific language. Only the
values that have a non-empty value are considered as translations and stored.
@param $object An instance of the entity type that holds the translations as values.
@param $lang The language of the translation. | [
"Save",
"a",
"translation",
"of",
"a",
"single",
"entity",
"for",
"a",
"specific",
"language",
".",
"Only",
"the",
"values",
"that",
"have",
"a",
"non",
"-",
"empty",
"value",
"are",
"considered",
"as",
"translations",
"and",
"stored",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/i18n/impl/DefaultLocalization.php#L291-L325 |
26,730 | iherwig/wcmf | src/wcmf/lib/i18n/impl/DefaultLocalization.php | DefaultLocalization.setTranslatedValue | private function setTranslatedValue(PersistentObject $object, $valueName, $translation, $useDefaults) {
$mapper = $object->getMapper();
$isTranslatable = $mapper != null && $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName)->hasTag('TRANSLATABLE') : false;
if ($isTranslatable) {
// ... | php | private function setTranslatedValue(PersistentObject $object, $valueName, $translation, $useDefaults) {
$mapper = $object->getMapper();
$isTranslatable = $mapper != null && $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName)->hasTag('TRANSLATABLE') : false;
if ($isTranslatable) {
// ... | [
"private",
"function",
"setTranslatedValue",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"valueName",
",",
"$",
"translation",
",",
"$",
"useDefaults",
")",
"{",
"$",
"mapper",
"=",
"$",
"object",
"->",
"getMapper",
"(",
")",
";",
"$",
"isTranslatable"... | Set a translated value in the given PersistentObject instance.
@param $object The object to set the value on. The object
is supposed to have it's values in the default language.
@param $valueName The name of the value to translate
@param $translation Translation for the value.
@param $useDefaults Boolean whether to use... | [
"Set",
"a",
"translated",
"value",
"in",
"the",
"given",
"PersistentObject",
"instance",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/i18n/impl/DefaultLocalization.php#L385-L398 |
26,731 | iherwig/wcmf | src/wcmf/lib/i18n/impl/DefaultLocalization.php | DefaultLocalization.saveTranslatedValue | private function saveTranslatedValue(PersistentObject $object, $valueName, $existingTranslation, $lang) {
$mapper = $object->getMapper();
$isTranslatable = $mapper != null && $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName)->hasTag('TRANSLATABLE') : false;
if ($isTranslatable) {
$... | php | private function saveTranslatedValue(PersistentObject $object, $valueName, $existingTranslation, $lang) {
$mapper = $object->getMapper();
$isTranslatable = $mapper != null && $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName)->hasTag('TRANSLATABLE') : false;
if ($isTranslatable) {
$... | [
"private",
"function",
"saveTranslatedValue",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"valueName",
",",
"$",
"existingTranslation",
",",
"$",
"lang",
")",
"{",
"$",
"mapper",
"=",
"$",
"object",
"->",
"getMapper",
"(",
")",
";",
"$",
"isTranslatabl... | Save translated values for the given object
@param $object The object to save the translations on
@param $valueName The name of the value to translate
@param $existingTranslation Existing translation instance for the value (might be null).
@param $lang The language of the translations. | [
"Save",
"translated",
"values",
"for",
"the",
"given",
"object"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/i18n/impl/DefaultLocalization.php#L407-L441 |
26,732 | iherwig/wcmf | src/wcmf/lib/i18n/impl/DefaultLocalization.php | DefaultLocalization.afterCreate | public function afterCreate(PersistenceEvent $event) {
if ($event->getAction() == PersistenceAction::CREATE) {
$oldOid = $event->getOldOid();
$oldOidStr = $oldOid != null ? $oldOid->__toString() : null;
if ($oldOidStr != null && isset($this->createdTranslations[$oldOidStr])) {
foreach ($th... | php | public function afterCreate(PersistenceEvent $event) {
if ($event->getAction() == PersistenceAction::CREATE) {
$oldOid = $event->getOldOid();
$oldOidStr = $oldOid != null ? $oldOid->__toString() : null;
if ($oldOidStr != null && isset($this->createdTranslations[$oldOidStr])) {
foreach ($th... | [
"public",
"function",
"afterCreate",
"(",
"PersistenceEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getAction",
"(",
")",
"==",
"PersistenceAction",
"::",
"CREATE",
")",
"{",
"$",
"oldOid",
"=",
"$",
"event",
"->",
"getOldOid",
"(",
")"... | Update oids after create
@param $event | [
"Update",
"oids",
"after",
"create"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/i18n/impl/DefaultLocalization.php#L447-L457 |
26,733 | iherwig/wcmf | src/wcmf/lib/security/impl/DefaultPermissionManager.php | DefaultPermissionManager.setPermissionType | public function setPermissionType($permissionType) {
$this->permissionType = $permissionType;
$this->actionKeyProvider->setEntityType($this->permissionType);
} | php | public function setPermissionType($permissionType) {
$this->permissionType = $permissionType;
$this->actionKeyProvider->setEntityType($this->permissionType);
} | [
"public",
"function",
"setPermissionType",
"(",
"$",
"permissionType",
")",
"{",
"$",
"this",
"->",
"permissionType",
"=",
"$",
"permissionType",
";",
"$",
"this",
"->",
"actionKeyProvider",
"->",
"setEntityType",
"(",
"$",
"this",
"->",
"permissionType",
")",
... | Set the entity type name of Permission instances.
@param $permissionType String | [
"Set",
"the",
"entity",
"type",
"name",
"of",
"Permission",
"instances",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/DefaultPermissionManager.php#L63-L66 |
26,734 | iherwig/wcmf | src/wcmf/lib/security/impl/DefaultPermissionManager.php | DefaultPermissionManager.getPermissionInstance | protected function getPermissionInstance($resource, $context, $action) {
$query = new ObjectQuery($this->permissionType, __CLASS__.__METHOD__);
$tpl = $query->getObjectTemplate($this->permissionType);
$tpl->setValue('resource', Criteria::asValue('=', $resource));
$tpl->setValue('context', Criteria::asVa... | php | protected function getPermissionInstance($resource, $context, $action) {
$query = new ObjectQuery($this->permissionType, __CLASS__.__METHOD__);
$tpl = $query->getObjectTemplate($this->permissionType);
$tpl->setValue('resource', Criteria::asValue('=', $resource));
$tpl->setValue('context', Criteria::asVa... | [
"protected",
"function",
"getPermissionInstance",
"(",
"$",
"resource",
",",
"$",
"context",
",",
"$",
"action",
")",
"{",
"$",
"query",
"=",
"new",
"ObjectQuery",
"(",
"$",
"this",
"->",
"permissionType",
",",
"__CLASS__",
".",
"__METHOD__",
")",
";",
"$"... | Get the permission object that matches the given parameters
@param $resource Resource
@param $context Context
@param $action Action
@return Instance of _permissionType or null | [
"Get",
"the",
"permission",
"object",
"that",
"matches",
"the",
"given",
"parameters"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/DefaultPermissionManager.php#L168-L176 |
26,735 | iherwig/wcmf | src/wcmf/lib/security/impl/DefaultPermissionManager.php | DefaultPermissionManager.createPermissionObject | protected function createPermissionObject($resource, $context, $action, $roles) {
$permission = $this->persistenceFacade->create($this->permissionType);
$permission->setValue('resource', $resource);
$permission->setValue('context', $context);
$permission->setValue('action', $action);
$permission->se... | php | protected function createPermissionObject($resource, $context, $action, $roles) {
$permission = $this->persistenceFacade->create($this->permissionType);
$permission->setValue('resource', $resource);
$permission->setValue('context', $context);
$permission->setValue('action', $action);
$permission->se... | [
"protected",
"function",
"createPermissionObject",
"(",
"$",
"resource",
",",
"$",
"context",
",",
"$",
"action",
",",
"$",
"roles",
")",
"{",
"$",
"permission",
"=",
"$",
"this",
"->",
"persistenceFacade",
"->",
"create",
"(",
"$",
"this",
"->",
"permissi... | Create a permission object with the given parameters
@param $resource Resource
@param $context Context
@param $action Action
@param $roles String representing the permissions as returned from serializePermissions()
@return Instance of _permissionType | [
"Create",
"a",
"permission",
"object",
"with",
"the",
"given",
"parameters"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/DefaultPermissionManager.php#L186-L193 |
26,736 | iherwig/wcmf | src/wcmf/lib/util/StringUtil.php | StringUtil.getUrls | public static function getUrls($string) {
preg_match_all("/<a[^>]+href=\"([^\">]+)/i", $string, $links);
// find urls in javascript popup links
for ($i=0; $i<sizeof($links[1]); $i++) {
if (preg_match_all("/javascript:.*window.open[\(]*'([^']+)/i", $links[1][$i], $popups)) {
$links[1][$i] = $p... | php | public static function getUrls($string) {
preg_match_all("/<a[^>]+href=\"([^\">]+)/i", $string, $links);
// find urls in javascript popup links
for ($i=0; $i<sizeof($links[1]); $i++) {
if (preg_match_all("/javascript:.*window.open[\(]*'([^']+)/i", $links[1][$i], $popups)) {
$links[1][$i] = $p... | [
"public",
"static",
"function",
"getUrls",
"(",
"$",
"string",
")",
"{",
"preg_match_all",
"(",
"\"/<a[^>]+href=\\\"([^\\\">]+)/i\"",
",",
"$",
"string",
",",
"$",
"links",
")",
";",
"// find urls in javascript popup links",
"for",
"(",
"$",
"i",
"=",
"0",
";",
... | Extraxt urls from a string.
@param $string The string to search in
@return An array with urls
@note This method searches for occurences of <a..href="xxx"..>, <img..src="xxx"..>, <video..src="xxx"..>,
<audio..src="xxx"..>, <input..src="xxx"..>, <form..action="xxx"..>, <link..href="xxx"..>, <script..src="xxx"..>
and extr... | [
"Extraxt",
"urls",
"from",
"a",
"string",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/StringUtil.php#L231-L254 |
26,737 | iherwig/wcmf | src/wcmf/lib/util/StringUtil.php | StringUtil.getBoolean | public static function getBoolean($string) {
$val = filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($val === null) {
return $string;
}
return $val;
} | php | public static function getBoolean($string) {
$val = filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($val === null) {
return $string;
}
return $val;
} | [
"public",
"static",
"function",
"getBoolean",
"(",
"$",
"string",
")",
"{",
"$",
"val",
"=",
"filter_var",
"(",
"$",
"string",
",",
"FILTER_VALIDATE_BOOLEAN",
",",
"FILTER_NULL_ON_FAILURE",
")",
";",
"if",
"(",
"$",
"val",
"===",
"null",
")",
"{",
"return"... | Get the boolean value of a string
@param $string
@return Boolean or the string, if it does not represent a boolean. | [
"Get",
"the",
"boolean",
"value",
"of",
"a",
"string"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/StringUtil.php#L401-L407 |
26,738 | GW2Treasures/gw2api | src/V2/Localization/LocalizationHandler.php | LocalizationHandler.onRequest | public function onRequest( RequestInterface $request ) {
$localizedUri = Uri::withQueryValue( $request->getUri(), 'lang', $this->getEndpoint()->getLang() );
return $request->withUri($localizedUri);
} | php | public function onRequest( RequestInterface $request ) {
$localizedUri = Uri::withQueryValue( $request->getUri(), 'lang', $this->getEndpoint()->getLang() );
return $request->withUri($localizedUri);
} | [
"public",
"function",
"onRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"localizedUri",
"=",
"Uri",
"::",
"withQueryValue",
"(",
"$",
"request",
"->",
"getUri",
"(",
")",
",",
"'lang'",
",",
"$",
"this",
"->",
"getEndpoint",
"(",
")",
... | Adds the `lang` query parameter to the request for localized endpoints.
@param RequestInterface $request
@return \Psr\Http\Message\RequestInterface | [
"Adds",
"the",
"lang",
"query",
"parameter",
"to",
"the",
"request",
"for",
"localized",
"endpoints",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Localization/LocalizationHandler.php#L26-L29 |
26,739 | iherwig/wcmf | src/wcmf/lib/model/output/ImageOutputStrategy.php | ImageOutputStrategy.drawConnectionLine | protected function drawConnectionLine($poid, $oid) {
list($start, $end) = $this->calculateEndPoints($poid, $oid);
if($this->lineType == self::LINETYPE_DIRECT) {
$this->drawDirectLine($start, $end);
}
else if($this->lineType == self::LINETYPE_ROUTED) {
$this->drawRoutedLine($start, $end);
... | php | protected function drawConnectionLine($poid, $oid) {
list($start, $end) = $this->calculateEndPoints($poid, $oid);
if($this->lineType == self::LINETYPE_DIRECT) {
$this->drawDirectLine($start, $end);
}
else if($this->lineType == self::LINETYPE_ROUTED) {
$this->drawRoutedLine($start, $end);
... | [
"protected",
"function",
"drawConnectionLine",
"(",
"$",
"poid",
",",
"$",
"oid",
")",
"{",
"list",
"(",
"$",
"start",
",",
"$",
"end",
")",
"=",
"$",
"this",
"->",
"calculateEndPoints",
"(",
"$",
"poid",
",",
"$",
"oid",
")",
";",
"if",
"(",
"$",
... | Draw connection line.
@param $poid The parent object's object id.
@param $oid The object's object id. | [
"Draw",
"connection",
"line",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/ImageOutputStrategy.php#L196-L204 |
26,740 | iherwig/wcmf | src/wcmf/lib/model/output/ImageOutputStrategy.php | ImageOutputStrategy.drawDirectLine | protected function drawDirectLine($start, $end) {
ImageLine($this->img,
$start->x,
$start->y,
$end->x,
$end->y,
$this->lineColor);
} | php | protected function drawDirectLine($start, $end) {
ImageLine($this->img,
$start->x,
$start->y,
$end->x,
$end->y,
$this->lineColor);
} | [
"protected",
"function",
"drawDirectLine",
"(",
"$",
"start",
",",
"$",
"end",
")",
"{",
"ImageLine",
"(",
"$",
"this",
"->",
"img",
",",
"$",
"start",
"->",
"x",
",",
"$",
"start",
"->",
"y",
",",
"$",
"end",
"->",
"x",
",",
"$",
"end",
"->",
... | Draw direct line.
@param $start The start point (Position).
@param $end The end point (Position). | [
"Draw",
"direct",
"line",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/ImageOutputStrategy.php#L211-L218 |
26,741 | iherwig/wcmf | src/wcmf/lib/model/output/ImageOutputStrategy.php | ImageOutputStrategy.drawRoutedLine | protected function drawRoutedLine($start, $end) {
if ($this->map["type"] == MAPTYPE_HORIZONTAL) {
ImageLine($this->img,
$start->x,
$start->y,
$start->x,
$start->y-($start->y-$end->y)/2,
$this->lineColor);
ImageLine($this->img,
$start->x,
$start->y-... | php | protected function drawRoutedLine($start, $end) {
if ($this->map["type"] == MAPTYPE_HORIZONTAL) {
ImageLine($this->img,
$start->x,
$start->y,
$start->x,
$start->y-($start->y-$end->y)/2,
$this->lineColor);
ImageLine($this->img,
$start->x,
$start->y-... | [
"protected",
"function",
"drawRoutedLine",
"(",
"$",
"start",
",",
"$",
"end",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"map",
"[",
"\"type\"",
"]",
"==",
"MAPTYPE_HORIZONTAL",
")",
"{",
"ImageLine",
"(",
"$",
"this",
"->",
"img",
",",
"$",
"start",
"... | Draw routed line.
@param $start The start point (Position).
@param $end The end point (Position). | [
"Draw",
"routed",
"line",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/ImageOutputStrategy.php#L225-L266 |
26,742 | iherwig/wcmf | src/wcmf/lib/model/output/ImageOutputStrategy.php | ImageOutputStrategy.calculateEndPoints | private function calculateEndPoints($poid, $oid) {
// from child...
if ($this->map["type"] == MAPTYPE_HORIZONTAL) {
// connect from mid top...
$x1 = $this->map[$oid]->x * $this->scale['x'] + ($this->labelDim['right'] - $this->labelDim['left'])/2 + $this->border;
$y1 = $this->map[$oid]->y * $th... | php | private function calculateEndPoints($poid, $oid) {
// from child...
if ($this->map["type"] == MAPTYPE_HORIZONTAL) {
// connect from mid top...
$x1 = $this->map[$oid]->x * $this->scale['x'] + ($this->labelDim['right'] - $this->labelDim['left'])/2 + $this->border;
$y1 = $this->map[$oid]->y * $th... | [
"private",
"function",
"calculateEndPoints",
"(",
"$",
"poid",
",",
"$",
"oid",
")",
"{",
"// from child...",
"if",
"(",
"$",
"this",
"->",
"map",
"[",
"\"type\"",
"]",
"==",
"MAPTYPE_HORIZONTAL",
")",
"{",
"// connect from mid top...",
"$",
"x1",
"=",
"$",
... | Calculate line end points.
@param $poid The parent object's object id.
@param $oid The object's object id.
@return Array containing start and end position | [
"Calculate",
"line",
"end",
"points",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/ImageOutputStrategy.php#L274-L298 |
26,743 | iherwig/wcmf | src/wcmf/lib/core/ClassLoader.php | ClassLoader.load | public function load($className) {
// search under baseDir assuming that namespaces match directories
$filename = $this->baseDir.str_replace("\\", "/", $className).'.php';
if (file_exists($filename)) {
include($filename);
}
} | php | public function load($className) {
// search under baseDir assuming that namespaces match directories
$filename = $this->baseDir.str_replace("\\", "/", $className).'.php';
if (file_exists($filename)) {
include($filename);
}
} | [
"public",
"function",
"load",
"(",
"$",
"className",
")",
"{",
"// search under baseDir assuming that namespaces match directories",
"$",
"filename",
"=",
"$",
"this",
"->",
"baseDir",
".",
"str_replace",
"(",
"\"\\\\\"",
",",
"\"/\"",
",",
"$",
"className",
")",
... | Load the given class definition
@param $className The class name | [
"Load",
"the",
"given",
"class",
"definition"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/ClassLoader.php#L40-L46 |
26,744 | iherwig/wcmf | src/wcmf/lib/presentation/Application.php | Application.initialize | public function initialize($defaultController='', $defaultContext='', $defaultAction='login') {
$config = ObjectFactory::getInstance('configuration');
$this->debug = $config->getBooleanValue('debug', 'Application');
// configure php
if ($config->hasSection('phpconfig')) {
$phpSettings = $config->... | php | public function initialize($defaultController='', $defaultContext='', $defaultAction='login') {
$config = ObjectFactory::getInstance('configuration');
$this->debug = $config->getBooleanValue('debug', 'Application');
// configure php
if ($config->hasSection('phpconfig')) {
$phpSettings = $config->... | [
"public",
"function",
"initialize",
"(",
"$",
"defaultController",
"=",
"''",
",",
"$",
"defaultContext",
"=",
"''",
",",
"$",
"defaultAction",
"=",
"'login'",
")",
"{",
"$",
"config",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'configuration'",
")",
"... | Initialize the request.
@param $defaultController The controller to call if none is given in request parameters (optional, default: '')
@param $defaultContext The context to set if none is given in request parameters (optional, default: '')
@param $defaultAction The action to perform if none is given in request parame... | [
"Initialize",
"the",
"request",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/Application.php#L71-L111 |
26,745 | iherwig/wcmf | src/wcmf/lib/presentation/Application.php | Application.run | public function run(Request $request) {
// process the requested action
ObjectFactory::getInstance('actionMapper')->processAction($request, $this->response);
return $this->response;
} | php | public function run(Request $request) {
// process the requested action
ObjectFactory::getInstance('actionMapper')->processAction($request, $this->response);
return $this->response;
} | [
"public",
"function",
"run",
"(",
"Request",
"$",
"request",
")",
"{",
"// process the requested action",
"ObjectFactory",
"::",
"getInstance",
"(",
"'actionMapper'",
")",
"->",
"processAction",
"(",
"$",
"request",
",",
"$",
"this",
"->",
"response",
")",
";",
... | Run the application with the given request
@param $request
@return Response instance | [
"Run",
"the",
"application",
"with",
"the",
"given",
"request"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/Application.php#L118-L122 |
26,746 | iherwig/wcmf | src/wcmf/lib/presentation/Application.php | Application.handleException | public function handleException(\Exception $exception) {
// get error level
$logFunction = 'error';
if ($exception instanceof ApplicationException) {
$logFunction = $exception->getError()->getLevel() == ApplicationError::LEVEL_WARNING ?
'warn' : 'error';
}
self::$logger->$logFunc... | php | public function handleException(\Exception $exception) {
// get error level
$logFunction = 'error';
if ($exception instanceof ApplicationException) {
$logFunction = $exception->getError()->getLevel() == ApplicationError::LEVEL_WARNING ?
'warn' : 'error';
}
self::$logger->$logFunc... | [
"public",
"function",
"handleException",
"(",
"\\",
"Exception",
"$",
"exception",
")",
"{",
"// get error level",
"$",
"logFunction",
"=",
"'error'",
";",
"if",
"(",
"$",
"exception",
"instanceof",
"ApplicationException",
")",
"{",
"$",
"logFunction",
"=",
"$",... | Default exception handling method. Rolls back the transaction and
executes 'failure' action.
@param $exception The Exception instance | [
"Default",
"exception",
"handling",
"method",
".",
"Rolls",
"back",
"the",
"transaction",
"and",
"executes",
"failure",
"action",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/Application.php#L129-L161 |
26,747 | iherwig/wcmf | src/wcmf/lib/presentation/Application.php | Application.outputHandler | public function outputHandler($buffer) {
// log last error, if it's level is enabled
$error = error_get_last();
if ($error !== null && (in_array($error['type'], [E_ERROR, E_PARSE, E_COMPILE_ERROR]))) {
$errorStr = $error['file']."::".$error['line'].": ".$error['type'].": ".$error['message'];
sel... | php | public function outputHandler($buffer) {
// log last error, if it's level is enabled
$error = error_get_last();
if ($error !== null && (in_array($error['type'], [E_ERROR, E_PARSE, E_COMPILE_ERROR]))) {
$errorStr = $error['file']."::".$error['line'].": ".$error['type'].": ".$error['message'];
sel... | [
"public",
"function",
"outputHandler",
"(",
"$",
"buffer",
")",
"{",
"// log last error, if it's level is enabled",
"$",
"error",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"$",
"error",
"!==",
"null",
"&&",
"(",
"in_array",
"(",
"$",
"error",
"[",
"'t... | This method is run as ob_start callback
@note must be public
@param $buffer The content to be returned to the client
@return String | [
"This",
"method",
"is",
"run",
"as",
"ob_start",
"callback"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/Application.php#L169-L185 |
26,748 | skie/plum_search | src/Controller/Component/FilterComponent.php | FilterComponent.parameters | public function parameters($reset = false)
{
if ($reset || is_null($this->_searchParameters)) {
$this->_searchParameters = new ParameterRegistry($this->_controller, []);
$parameters = (array)$this->config('parameters');
foreach ($parameters as $parameter) {
... | php | public function parameters($reset = false)
{
if ($reset || is_null($this->_searchParameters)) {
$this->_searchParameters = new ParameterRegistry($this->_controller, []);
$parameters = (array)$this->config('parameters');
foreach ($parameters as $parameter) {
... | [
"public",
"function",
"parameters",
"(",
"$",
"reset",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"reset",
"||",
"is_null",
"(",
"$",
"this",
"->",
"_searchParameters",
")",
")",
"{",
"$",
"this",
"->",
"_searchParameters",
"=",
"new",
"ParameterRegistry",
... | Returns parameters registry instance
@param bool $reset Reset flag.
@return \PlumSearch\FormParameter\ParameterRegistry | [
"Returns",
"parameters",
"registry",
"instance"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Controller/Component/FilterComponent.php#L71-L84 |
26,749 | skie/plum_search | src/Controller/Component/FilterComponent.php | FilterComponent.prg | public function prg($table, $options = [])
{
$this->config($options);
$formName = $this->_initParam('formName', $this->config('formName'));
$action = $this->_initParam('action', $this->controller()->request->params['action']);
$this->parameters()->config([
'formName' =>... | php | public function prg($table, $options = [])
{
$this->config($options);
$formName = $this->_initParam('formName', $this->config('formName'));
$action = $this->_initParam('action', $this->controller()->request->params['action']);
$this->parameters()->config([
'formName' =>... | [
"public",
"function",
"prg",
"(",
"$",
"table",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"config",
"(",
"$",
"options",
")",
";",
"$",
"formName",
"=",
"$",
"this",
"->",
"_initParam",
"(",
"'formName'",
",",
"$",
"this",
... | Implements Post Redirect Get flow method.
For POST requests builds redirection url and perform redirect to get action.
For GET requests add filters finder to passed into the method query and returns it.
@param Table $table Table instance.
@param array $options Search parameters.
@return mixed | [
"Implements",
"Post",
"Redirect",
"Get",
"flow",
"method",
".",
"For",
"POST",
"requests",
"builds",
"redirection",
"url",
"and",
"perform",
"redirect",
"to",
"get",
"action",
".",
"For",
"GET",
"requests",
"add",
"filters",
"finder",
"to",
"passed",
"into",
... | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Controller/Component/FilterComponent.php#L138-L157 |
26,750 | skie/plum_search | src/Controller/Component/FilterComponent.php | FilterComponent._redirect | protected function _redirect($action)
{
$params = $this->controller()->request->params['pass'];
$searchParams = array_diff_key(
array_merge(
$this->controller()->request->query,
$this->values()
),
array_flip(
(array)... | php | protected function _redirect($action)
{
$params = $this->controller()->request->params['pass'];
$searchParams = array_diff_key(
array_merge(
$this->controller()->request->query,
$this->values()
),
array_flip(
(array)... | [
"protected",
"function",
"_redirect",
"(",
"$",
"action",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"controller",
"(",
")",
"->",
"request",
"->",
"params",
"[",
"'pass'",
"]",
";",
"$",
"searchParams",
"=",
"array_diff_key",
"(",
"array_merge",
"... | Redirect action method
@param string $action Action name.
@return void | [
"Redirect",
"action",
"method"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Controller/Component/FilterComponent.php#L202-L225 |
26,751 | skie/plum_search | src/Controller/Component/FilterComponent.php | FilterComponent._setViewData | protected function _setViewData($formName)
{
$this->controller()->request->data($formName, $this->parameters()->viewValues());
$this->controller()->set('searchParameters', $this->parameters());
} | php | protected function _setViewData($formName)
{
$this->controller()->request->data($formName, $this->parameters()->viewValues());
$this->controller()->set('searchParameters', $this->parameters());
} | [
"protected",
"function",
"_setViewData",
"(",
"$",
"formName",
")",
"{",
"$",
"this",
"->",
"controller",
"(",
")",
"->",
"request",
"->",
"data",
"(",
"$",
"formName",
",",
"$",
"this",
"->",
"parameters",
"(",
")",
"->",
"viewValues",
"(",
")",
")",
... | Set up view data
@param string $formName Form name.
@return void | [
"Set",
"up",
"view",
"data"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Controller/Component/FilterComponent.php#L233-L237 |
26,752 | skie/plum_search | src/Model/Behavior/FilterableBehavior.php | FilterableBehavior.filters | public function filters($reset = false)
{
if ($reset || is_null($this->_searchFilters)) {
$this->_searchFilters = new FilterRegistry($this->_table);
}
return $this->_searchFilters;
} | php | public function filters($reset = false)
{
if ($reset || is_null($this->_searchFilters)) {
$this->_searchFilters = new FilterRegistry($this->_table);
}
return $this->_searchFilters;
} | [
"public",
"function",
"filters",
"(",
"$",
"reset",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"reset",
"||",
"is_null",
"(",
"$",
"this",
"->",
"_searchFilters",
")",
")",
"{",
"$",
"this",
"->",
"_searchFilters",
"=",
"new",
"FilterRegistry",
"(",
"$",
... | Returns filter registry instance
@param bool $reset Reset flag.
@return \PlumSearch\Model\FilterRegistry | [
"Returns",
"filter",
"registry",
"instance"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/Behavior/FilterableBehavior.php#L77-L84 |
26,753 | skie/plum_search | src/Model/Behavior/FilterableBehavior.php | FilterableBehavior.findFilter | public function findFilter(Query $query, array $options)
{
foreach ($this->filters()->collection() as $name => $filter) {
$filter->apply($query, $options);
}
return $query;
} | php | public function findFilter(Query $query, array $options)
{
foreach ($this->filters()->collection() as $name => $filter) {
$filter->apply($query, $options);
}
return $query;
} | [
"public",
"function",
"findFilter",
"(",
"Query",
"$",
"query",
",",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"(",
")",
"->",
"collection",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"filter",
")",
"{",
"$",
"fi... | Results for this finder will be query filtered by search parameters
@param \Cake\ORM\Query $query Query.
@param array $options Array of options as described above.
@return \Cake\ORM\Query | [
"Results",
"for",
"this",
"finder",
"will",
"be",
"query",
"filtered",
"by",
"search",
"parameters"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/Behavior/FilterableBehavior.php#L141-L148 |
26,754 | vufind-org/vufindharvest | src/RecordWriterStrategy/RecordWriterStrategyFactory.php | RecordWriterStrategyFactory.getStrategy | public function getStrategy($basePath, $settings = [])
{
if (isset($settings['combineRecords']) && $settings['combineRecords']) {
$combineTag = $settings['combineRecordsTag'] ?? null;
return new CombinedRecordWriterStrategy($basePath, $combineTag);
}
return new Indivi... | php | public function getStrategy($basePath, $settings = [])
{
if (isset($settings['combineRecords']) && $settings['combineRecords']) {
$combineTag = $settings['combineRecordsTag'] ?? null;
return new CombinedRecordWriterStrategy($basePath, $combineTag);
}
return new Indivi... | [
"public",
"function",
"getStrategy",
"(",
"$",
"basePath",
",",
"$",
"settings",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"settings",
"[",
"'combineRecords'",
"]",
")",
"&&",
"$",
"settings",
"[",
"'combineRecords'",
"]",
")",
"{",
"$",
... | Build writer strategy object.
@param string $basePath Base path for harvest
@param array $settings Configuration settings
@return RecordWriterStrategyInterface | [
"Build",
"writer",
"strategy",
"object",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/RecordWriterStrategy/RecordWriterStrategyFactory.php#L49-L56 |
26,755 | skie/plum_search | src/Model/FilterRegistry.php | FilterRegistry._create | protected function _create($class, $alias, $config)
{
if (empty($config['name'])) {
$config['name'] = $alias;
}
$instance = new $class($this, $config);
return $instance;
} | php | protected function _create($class, $alias, $config)
{
if (empty($config['name'])) {
$config['name'] = $alias;
}
$instance = new $class($this, $config);
return $instance;
} | [
"protected",
"function",
"_create",
"(",
"$",
"class",
",",
"$",
"alias",
",",
"$",
"config",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"config",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'name'",
"]",
"=",
"$",
"alias",
";",
"}",
"... | Create the filter instance.
Part of the template method for Cake\Core\ObjectRegistry::load()
Enabled filters will be registered with the event manager.
@param string $class The class name to create.
@param string $alias The alias of the filter.
@param array $config An array of config to use for the filter.
@return... | [
"Create",
"the",
"filter",
"instance",
"."
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/FilterRegistry.php#L92-L100 |
26,756 | iherwig/wcmf | src/wcmf/application/controller/TreeController.php | TreeController.getChildren | protected function getChildren($oid) {
$permissionManager = $this->getPermissionManager();
$persistenceFacade = $this->getPersistenceFacade();
// check read permission on type
$type = $oid->getType();
if (!$permissionManager->authorize($type, '', PersistenceAction::READ)) {
return [];
}
... | php | protected function getChildren($oid) {
$permissionManager = $this->getPermissionManager();
$persistenceFacade = $this->getPersistenceFacade();
// check read permission on type
$type = $oid->getType();
if (!$permissionManager->authorize($type, '', PersistenceAction::READ)) {
return [];
}
... | [
"protected",
"function",
"getChildren",
"(",
"$",
"oid",
")",
"{",
"$",
"permissionManager",
"=",
"$",
"this",
"->",
"getPermissionManager",
"(",
")",
";",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"// check read ... | Get the children for a given oid.
@param $oid The object id
@return Array of Node instances. | [
"Get",
"the",
"children",
"for",
"a",
"given",
"oid",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/TreeController.php#L88-L122 |
26,757 | iherwig/wcmf | src/wcmf/application/controller/TreeController.php | TreeController.getViewNode | protected function getViewNode(Node $node, $displayText='') {
if (strlen($displayText) == 0) {
$displayText = trim($this->getDisplayText($node));
}
if (strlen($displayText) == 0) {
$displayText = '-';
}
$oid = $node->getOID();
$isFolder = $oid->containsDummyIds();
$hasChildren = ... | php | protected function getViewNode(Node $node, $displayText='') {
if (strlen($displayText) == 0) {
$displayText = trim($this->getDisplayText($node));
}
if (strlen($displayText) == 0) {
$displayText = '-';
}
$oid = $node->getOID();
$isFolder = $oid->containsDummyIds();
$hasChildren = ... | [
"protected",
"function",
"getViewNode",
"(",
"Node",
"$",
"node",
",",
"$",
"displayText",
"=",
"''",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"displayText",
")",
"==",
"0",
")",
"{",
"$",
"displayText",
"=",
"trim",
"(",
"$",
"this",
"->",
"getDispl... | Get the view of a Node
@param $node The Node to create the view for
@param $displayText The text to display (will be taken from TreeController::getDisplayText() if not specified) (default: '')
@return An associative array whose keys correspond to Ext.tree.TreeNode config parameters | [
"Get",
"the",
"view",
"of",
"a",
"Node"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/TreeController.php#L139-L155 |
26,758 | iherwig/wcmf | src/wcmf/application/controller/TreeController.php | TreeController.getDisplayText | protected function getDisplayText(Node $node) {
if ($this->isRootTypeNode($node->getOID())) {
$mapper = $node->getMapper();
return $mapper->getTypeDisplayName($this->getMessage());
}
else {
return strip_tags(preg_replace("/[\r\n']/", " ", NodeUtil::getDisplayValue($node)));
}
} | php | protected function getDisplayText(Node $node) {
if ($this->isRootTypeNode($node->getOID())) {
$mapper = $node->getMapper();
return $mapper->getTypeDisplayName($this->getMessage());
}
else {
return strip_tags(preg_replace("/[\r\n']/", " ", NodeUtil::getDisplayValue($node)));
}
} | [
"protected",
"function",
"getDisplayText",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRootTypeNode",
"(",
"$",
"node",
"->",
"getOID",
"(",
")",
")",
")",
"{",
"$",
"mapper",
"=",
"$",
"node",
"->",
"getMapper",
"(",
")",
... | Get the display text for a Node
@param $node Node to display
@return The display text. | [
"Get",
"the",
"display",
"text",
"for",
"a",
"Node"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/TreeController.php#L171-L179 |
26,759 | iherwig/wcmf | src/wcmf/application/controller/TreeController.php | TreeController.getRootTypes | protected function getRootTypes() {
$types = null;
$config = $this->getConfiguration();
// get root types from configuration
// try request value first
$request = $this->getRequest();
$rootTypeVar = $request->getValue('rootTypes');
if ($config->hasValue($rootTypeVar, 'application')) {
... | php | protected function getRootTypes() {
$types = null;
$config = $this->getConfiguration();
// get root types from configuration
// try request value first
$request = $this->getRequest();
$rootTypeVar = $request->getValue('rootTypes');
if ($config->hasValue($rootTypeVar, 'application')) {
... | [
"protected",
"function",
"getRootTypes",
"(",
")",
"{",
"$",
"types",
"=",
"null",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"// get root types from configuration",
"// try request value first",
"$",
"request",
"=",
"$",
"thi... | Get all root types
@return Array of Node instances | [
"Get",
"all",
"root",
"types"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/TreeController.php#L185-L215 |
26,760 | iherwig/wcmf | src/wcmf/application/controller/TreeController.php | TreeController.isRootTypeNode | protected function isRootTypeNode(ObjectId $oid) {
if ($oid->containsDummyIds()) {
$type = $oid->getType();
$rootTypes = $this->getRootTypes();
foreach ($rootTypes as $rootType) {
if ($rootType->getType() == $type) {
return true;
}
}
}
return false;
} | php | protected function isRootTypeNode(ObjectId $oid) {
if ($oid->containsDummyIds()) {
$type = $oid->getType();
$rootTypes = $this->getRootTypes();
foreach ($rootTypes as $rootType) {
if ($rootType->getType() == $type) {
return true;
}
}
}
return false;
} | [
"protected",
"function",
"isRootTypeNode",
"(",
"ObjectId",
"$",
"oid",
")",
"{",
"if",
"(",
"$",
"oid",
"->",
"containsDummyIds",
"(",
")",
")",
"{",
"$",
"type",
"=",
"$",
"oid",
"->",
"getType",
"(",
")",
";",
"$",
"rootTypes",
"=",
"$",
"this",
... | Check if the given oid belongs to a root type node
@param $oid The object id
@return Boolean | [
"Check",
"if",
"the",
"given",
"oid",
"belongs",
"to",
"a",
"root",
"type",
"node"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/TreeController.php#L222-L233 |
26,761 | iherwig/wcmf | src/wcmf/lib/security/principal/impl/AbstractUser.php | AbstractUser.ensureHashedPassword | protected function ensureHashedPassword() {
// the password is expected to be stored in the 'password' value
$password = $this->getValue('password');
if (strlen($password) > 0 && !PasswordService::isHashed($password)) {
$this->setValue('password', PasswordService::hash($password));
}
} | php | protected function ensureHashedPassword() {
// the password is expected to be stored in the 'password' value
$password = $this->getValue('password');
if (strlen($password) > 0 && !PasswordService::isHashed($password)) {
$this->setValue('password', PasswordService::hash($password));
}
} | [
"protected",
"function",
"ensureHashedPassword",
"(",
")",
"{",
"// the password is expected to be stored in the 'password' value",
"$",
"password",
"=",
"$",
"this",
"->",
"getValue",
"(",
"'password'",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"password",
")",
">",... | Hash password property if not done already. | [
"Hash",
"password",
"property",
"if",
"not",
"done",
"already",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/principal/impl/AbstractUser.php#L160-L166 |
26,762 | iherwig/wcmf | src/wcmf/lib/security/principal/impl/AbstractUser.php | AbstractUser.setRoleConfig | protected function setRoleConfig() {
if (strlen($this->getConfig()) == 0) {
// check added nodes for Role instances
foreach ($this->getAddedNodes() as $relationName => $nodes) {
foreach ($nodes as $node) {
if ($node instanceof Role) {
$roleName = $node->getName();
... | php | protected function setRoleConfig() {
if (strlen($this->getConfig()) == 0) {
// check added nodes for Role instances
foreach ($this->getAddedNodes() as $relationName => $nodes) {
foreach ($nodes as $node) {
if ($node instanceof Role) {
$roleName = $node->getName();
... | [
"protected",
"function",
"setRoleConfig",
"(",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
")",
"==",
"0",
")",
"{",
"// check added nodes for Role instances",
"foreach",
"(",
"$",
"this",
"->",
"getAddedNodes",
"(",
")",
... | Set the configuration of the currently associated role, if no
configuration is set already. | [
"Set",
"the",
"configuration",
"of",
"the",
"currently",
"associated",
"role",
"if",
"no",
"configuration",
"is",
"set",
"already",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/principal/impl/AbstractUser.php#L172-L188 |
26,763 | iherwig/wcmf | src/wcmf/lib/security/principal/impl/AbstractUser.php | AbstractUser.getRoleConfigs | protected static function getRoleConfigs() {
if (self::$roleConfig == null) {
// load role config if existing
$config = ObjectFactory::getInstance('configuration');
if (($roleConfig = $config->getSection('roleconfig')) !== false) {
self::$roleConfig = $roleConfig;
}
}
return ... | php | protected static function getRoleConfigs() {
if (self::$roleConfig == null) {
// load role config if existing
$config = ObjectFactory::getInstance('configuration');
if (($roleConfig = $config->getSection('roleconfig')) !== false) {
self::$roleConfig = $roleConfig;
}
}
return ... | [
"protected",
"static",
"function",
"getRoleConfigs",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"roleConfig",
"==",
"null",
")",
"{",
"// load role config if existing",
"$",
"config",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'configuration'",
")",
";",... | Get the role configurations from the application configuration
@return Array with role names as keys and config file names as values | [
"Get",
"the",
"role",
"configurations",
"from",
"the",
"application",
"configuration"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/principal/impl/AbstractUser.php#L236-L245 |
26,764 | iherwig/wcmf | src/wcmf/lib/security/principal/impl/AbstractUser.php | AbstractUser.getAuthUser | protected function getAuthUser() {
$principalFactory = ObjectFactory::getInstance('principalFactory');
$session = ObjectFactory::getInstance('session');
return $principalFactory->getUser($session->getAuthUser());
} | php | protected function getAuthUser() {
$principalFactory = ObjectFactory::getInstance('principalFactory');
$session = ObjectFactory::getInstance('session');
return $principalFactory->getUser($session->getAuthUser());
} | [
"protected",
"function",
"getAuthUser",
"(",
")",
"{",
"$",
"principalFactory",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'principalFactory'",
")",
";",
"$",
"session",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'session'",
")",
";",
"return",
"$",
... | Get the currently authenticated user
@return User | [
"Get",
"the",
"currently",
"authenticated",
"user"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/principal/impl/AbstractUser.php#L251-L255 |
26,765 | iherwig/wcmf | src/wcmf/lib/persistence/impl/AbstractMapper.php | AbstractMapper.authorizationFailedError | protected function authorizationFailedError($resource, $action) {
// when reading only log the error to avoid errors on the display
$msg = ObjectFactory::getInstance('message')->
getText("Authorization failed for action '%0%' on '%1%'.", [$action, $resource]);
if ($action == PersistenceAction::R... | php | protected function authorizationFailedError($resource, $action) {
// when reading only log the error to avoid errors on the display
$msg = ObjectFactory::getInstance('message')->
getText("Authorization failed for action '%0%' on '%1%'.", [$action, $resource]);
if ($action == PersistenceAction::R... | [
"protected",
"function",
"authorizationFailedError",
"(",
"$",
"resource",
",",
"$",
"action",
")",
"{",
"// when reading only log the error to avoid errors on the display",
"$",
"msg",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'message'",
")",
"->",
"getText",
"... | Handle an authorization error.
@param $resource
@param $action
@throws AuthorizationException | [
"Handle",
"an",
"authorization",
"error",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/AbstractMapper.php#L403-L413 |
26,766 | iherwig/wcmf | src/wcmf/lib/persistence/impl/AbstractMapper.php | AbstractMapper.initRelations | private function initRelations() {
if ($this->relations == null) {
$this->relations = [];
$this->relations['byrole'] = [];
$this->relations['bytype'] = [];
$relations = $this->getRelations();
foreach ($relations as $relation) {
$this->relations['byrole'][$relation->getOtherRol... | php | private function initRelations() {
if ($this->relations == null) {
$this->relations = [];
$this->relations['byrole'] = [];
$this->relations['bytype'] = [];
$relations = $this->getRelations();
foreach ($relations as $relation) {
$this->relations['byrole'][$relation->getOtherRol... | [
"private",
"function",
"initRelations",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"relations",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"relations",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"relations",
"[",
"'byrole'",
"]",
"=",
"[",
"]",
";",
... | Initialize relations. | [
"Initialize",
"relations",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/AbstractMapper.php#L418-L435 |
26,767 | Aerendir/PHPValueObjects | src/CurrencyExchangeRate/CurrencyExchangeRate.php | CurrencyExchangeRate.setExchangeRate | protected function setExchangeRate(float $exchangeRate): void
{
if ( ! is_float($exchangeRate)) {
throw new \InvalidArgumentException(sprintf('ExchangeRate has to be a float. %s given.', gettype($exchangeRate)));
}
$this->exchangeRate = $exchangeRate;
} | php | protected function setExchangeRate(float $exchangeRate): void
{
if ( ! is_float($exchangeRate)) {
throw new \InvalidArgumentException(sprintf('ExchangeRate has to be a float. %s given.', gettype($exchangeRate)));
}
$this->exchangeRate = $exchangeRate;
} | [
"protected",
"function",
"setExchangeRate",
"(",
"float",
"$",
"exchangeRate",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_float",
"(",
"$",
"exchangeRate",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'ExchangeRate has... | Set the conversion rate of the currency.
@param float $exchangeRate | [
"Set",
"the",
"conversion",
"rate",
"of",
"the",
"currency",
"."
] | 5ef646e593e411bf1b678755ff552a00a245d4c9 | https://github.com/Aerendir/PHPValueObjects/blob/5ef646e593e411bf1b678755ff552a00a245d4c9/src/CurrencyExchangeRate/CurrencyExchangeRate.php#L95-L102 |
26,768 | iherwig/wcmf | src/wcmf/lib/model/ObjectQueryUnionQueryProvider.php | ObjectQueryUnionQueryProvider.getLastQueryStrings | public function getLastQueryStrings() {
$result = [];
foreach ($this->queries as $query) {
$result[] = $query->getLastQueryString();
}
return $result;
} | php | public function getLastQueryStrings() {
$result = [];
foreach ($this->queries as $query) {
$result[] = $query->getLastQueryString();
}
return $result;
} | [
"public",
"function",
"getLastQueryStrings",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"queries",
"as",
"$",
"query",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"query",
"->",
"getLastQueryString",
"(",
")... | Get the last query strings
@return Array of string | [
"Get",
"the",
"last",
"query",
"strings"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQueryUnionQueryProvider.php#L62-L68 |
26,769 | iherwig/wcmf | src/wcmf/lib/model/NodeIterator.php | NodeIterator.addToQueue | protected function addToQueue($nodeList) {
for ($i=sizeof($nodeList)-1; $i>=0; $i--) {
if ($nodeList[$i] instanceof Node) {
$this->nodeList[] = $nodeList[$i];
}
}
} | php | protected function addToQueue($nodeList) {
for ($i=sizeof($nodeList)-1; $i>=0; $i--) {
if ($nodeList[$i] instanceof Node) {
$this->nodeList[] = $nodeList[$i];
}
}
} | [
"protected",
"function",
"addToQueue",
"(",
"$",
"nodeList",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"sizeof",
"(",
"$",
"nodeList",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"if",
"(",
"$",
"nodeList",
"[",
"$",
"i... | Add nodes to the processing queue.
@param $nodeList An array of nodes. | [
"Add",
"nodes",
"to",
"the",
"processing",
"queue",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeIterator.php#L144-L150 |
26,770 | GW2Treasures/gw2api | src/V2/Endpoint/Guild/RestrictedGuildHandler.php | RestrictedGuildHandler.onError | public function onError(ResponseInterface $response, RequestInterface $request) {
$json = $this->getResponseAsJson( $response );
if( !is_null( $json ) && isset( $json->text )) {
if( $json->text === 'access restricted to guild leaders' ) {
throw new GuildLeaderRequiredExceptio... | php | public function onError(ResponseInterface $response, RequestInterface $request) {
$json = $this->getResponseAsJson( $response );
if( !is_null( $json ) && isset( $json->text )) {
if( $json->text === 'access restricted to guild leaders' ) {
throw new GuildLeaderRequiredExceptio... | [
"public",
"function",
"onError",
"(",
"ResponseInterface",
"$",
"response",
",",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"json",
"=",
"$",
"this",
"->",
"getResponseAsJson",
"(",
"$",
"response",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
... | Handle errors by the api.
@param ResponseInterface $response
@param RequestInterface $request
@throws GuildLeaderRequiredException
@throws MembershipRequiredException | [
"Handle",
"errors",
"by",
"the",
"api",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Endpoint/Guild/RestrictedGuildHandler.php#L28-L37 |
26,771 | iherwig/wcmf | src/wcmf/lib/io/FileUtil.php | FileUtil.getMimeType | public static function getMimeType($file) {
$defaultType = 'application/octet-stream';
if (class_exists('\FileInfo')) {
// use extension
$fileInfo = new finfo(FILEINFO_MIME);
$fileType = $fileInfo->file(file_get_contents($file));
}
else {
// try detect image mime type
$imag... | php | public static function getMimeType($file) {
$defaultType = 'application/octet-stream';
if (class_exists('\FileInfo')) {
// use extension
$fileInfo = new finfo(FILEINFO_MIME);
$fileType = $fileInfo->file(file_get_contents($file));
}
else {
// try detect image mime type
$imag... | [
"public",
"static",
"function",
"getMimeType",
"(",
"$",
"file",
")",
"{",
"$",
"defaultType",
"=",
"'application/octet-stream'",
";",
"if",
"(",
"class_exists",
"(",
"'\\FileInfo'",
")",
")",
"{",
"// use extension",
"$",
"fileInfo",
"=",
"new",
"finfo",
"(",... | Get the mime type of the given file
@param $file The file
@return String | [
"Get",
"the",
"mime",
"type",
"of",
"the",
"given",
"file"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/FileUtil.php#L66-L79 |
26,772 | iherwig/wcmf | src/wcmf/lib/io/FileUtil.php | FileUtil.copyRecDir | public static function copyRecDir($source, $dest) {
if (!is_dir($dest)) {
self::mkdirRec($dest);
}
$dir = opendir($source);
while ($file = readdir($dir)) {
if ($file == "." || $file == "..") {
continue;
}
self::copyRec("$source/$file", "$dest/$file");
}
closedir($... | php | public static function copyRecDir($source, $dest) {
if (!is_dir($dest)) {
self::mkdirRec($dest);
}
$dir = opendir($source);
while ($file = readdir($dir)) {
if ($file == "." || $file == "..") {
continue;
}
self::copyRec("$source/$file", "$dest/$file");
}
closedir($... | [
"public",
"static",
"function",
"copyRecDir",
"(",
"$",
"source",
",",
"$",
"dest",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dest",
")",
")",
"{",
"self",
"::",
"mkdirRec",
"(",
"$",
"dest",
")",
";",
"}",
"$",
"dir",
"=",
"opendir",
"(",
... | Recursive copy for directories.
@param $source The name of the source directory
@param $dest The name of the destination directory | [
"Recursive",
"copy",
"for",
"directories",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/FileUtil.php#L196-L208 |
26,773 | iherwig/wcmf | src/wcmf/lib/io/FileUtil.php | FileUtil.fixFilename | public static function fixFilename($file) {
if (file_exists($file)) {
return $file;
}
else {
$file = iconv('utf-8', 'cp1252', $file);
if (file_exists($file)) {
return $file;
}
}
return null;
} | php | public static function fixFilename($file) {
if (file_exists($file)) {
return $file;
}
else {
$file = iconv('utf-8', 'cp1252', $file);
if (file_exists($file)) {
return $file;
}
}
return null;
} | [
"public",
"static",
"function",
"fixFilename",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"return",
"$",
"file",
";",
"}",
"else",
"{",
"$",
"file",
"=",
"iconv",
"(",
"'utf-8'",
",",
"'cp1252'",
",",
"$"... | Fix the name of an existing file to be used with php file functions
@param $file
@return String or null, if the file does not exist | [
"Fix",
"the",
"name",
"of",
"an",
"existing",
"file",
"to",
"be",
"used",
"with",
"php",
"file",
"functions"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/FileUtil.php#L286-L297 |
26,774 | iherwig/wcmf | src/wcmf/lib/io/FileUtil.php | FileUtil.urlencodeFilename | public static function urlencodeFilename($file) {
$parts = explode('/', $file);
$result = [];
foreach ($parts as $part) {
$result[] = rawurlencode($part);
}
return join('/', $result);
} | php | public static function urlencodeFilename($file) {
$parts = explode('/', $file);
$result = [];
foreach ($parts as $part) {
$result[] = rawurlencode($part);
}
return join('/', $result);
} | [
"public",
"static",
"function",
"urlencodeFilename",
"(",
"$",
"file",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'/'",
",",
"$",
"file",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"part",
")",
"{",
"... | Url encode a file path
@param $file
@return String | [
"Url",
"encode",
"a",
"file",
"path"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/io/FileUtil.php#L304-L311 |
26,775 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.getObjectTemplate | public function getObjectTemplate($type, $alias=null, $combineOperator=Criteria::OPERATOR_AND) {
$template = null;
// use the typeNode, the first time a node template of the query type is requested
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$fqType = $persistenceFacade->getFu... | php | public function getObjectTemplate($type, $alias=null, $combineOperator=Criteria::OPERATOR_AND) {
$template = null;
// use the typeNode, the first time a node template of the query type is requested
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$fqType = $persistenceFacade->getFu... | [
"public",
"function",
"getObjectTemplate",
"(",
"$",
"type",
",",
"$",
"alias",
"=",
"null",
",",
"$",
"combineOperator",
"=",
"Criteria",
"::",
"OPERATOR_AND",
")",
"{",
"$",
"template",
"=",
"null",
";",
"// use the typeNode, the first time a node template of the ... | Get an object template for a given type.
@param $type The type to query for
@param $alias An alias name to be used in the query. if null, use the default name (default: _null_)
@param $combineOperator One of the Criteria::OPERATOR constants that precedes
the conditions described in the template (default: _Criteria::OPE... | [
"Get",
"an",
"object",
"template",
"for",
"a",
"given",
"type",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L169-L194 |
26,776 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.registerObjectTemplate | public function registerObjectTemplate(Node $template, $alias=null, $combineOperator=Criteria::OPERATOR_AND) {
if ($template != null) {
$initialOid = $template->getOID();
$initialOidStr = $initialOid->__toString();
$template->setProperty(self::PROPERTY_INITIAL_OID, $initialOidStr);
$this->ob... | php | public function registerObjectTemplate(Node $template, $alias=null, $combineOperator=Criteria::OPERATOR_AND) {
if ($template != null) {
$initialOid = $template->getOID();
$initialOidStr = $initialOid->__toString();
$template->setProperty(self::PROPERTY_INITIAL_OID, $initialOidStr);
$this->ob... | [
"public",
"function",
"registerObjectTemplate",
"(",
"Node",
"$",
"template",
",",
"$",
"alias",
"=",
"null",
",",
"$",
"combineOperator",
"=",
"Criteria",
"::",
"OPERATOR_AND",
")",
"{",
"if",
"(",
"$",
"template",
"!=",
"null",
")",
"{",
"$",
"initialOid... | Register an object template at the query.
@param $template Node instance to register as template
@param $alias An alias name to be used in the query. if null, use the default name (default: _null_)
@param $combineOperator One of the Criteria::OPERATOR constants that precedes
the conditions described in the template (de... | [
"Register",
"an",
"object",
"template",
"at",
"the",
"query",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L203-L234 |
26,777 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.makeGroup | public function makeGroup($templates, $combineOperator=Criteria::OPERATOR_AND) {
$this->groups[] = ['tpls' => $templates, self::PROPERTY_COMBINE_OPERATOR => $combineOperator];
// store grouped nodes in an extra array to separate them from the others
for ($i=0; $i<sizeof($templates); $i++) {
if ($templ... | php | public function makeGroup($templates, $combineOperator=Criteria::OPERATOR_AND) {
$this->groups[] = ['tpls' => $templates, self::PROPERTY_COMBINE_OPERATOR => $combineOperator];
// store grouped nodes in an extra array to separate them from the others
for ($i=0; $i<sizeof($templates); $i++) {
if ($templ... | [
"public",
"function",
"makeGroup",
"(",
"$",
"templates",
",",
"$",
"combineOperator",
"=",
"Criteria",
"::",
"OPERATOR_AND",
")",
"{",
"$",
"this",
"->",
"groups",
"[",
"]",
"=",
"[",
"'tpls'",
"=>",
"$",
"templates",
",",
"self",
"::",
"PROPERTY_COMBINE_... | Group different templates together to realize brackets in the query.
@note Grouped templates will be ignored, when iterating over the object tree and appended at the end.
@param $templates An array of references to the templates contained in the group
@param $combineOperator One of the Criteria::OPERATOR constants that... | [
"Group",
"different",
"templates",
"together",
"to",
"realize",
"brackets",
"in",
"the",
"query",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L242-L253 |
26,778 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.getQueryCondition | public function getQueryCondition() {
$query = $this->getQueryString();
$tmp = preg_split("/ WHERE /i", $query);
if (sizeof($tmp) > 1) {
$tmp = preg_split("/ ORDER /i", $tmp[1]);
return $tmp[0];
}
return '';
} | php | public function getQueryCondition() {
$query = $this->getQueryString();
$tmp = preg_split("/ WHERE /i", $query);
if (sizeof($tmp) > 1) {
$tmp = preg_split("/ ORDER /i", $tmp[1]);
return $tmp[0];
}
return '';
} | [
"public",
"function",
"getQueryCondition",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryString",
"(",
")",
";",
"$",
"tmp",
"=",
"preg_split",
"(",
"\"/ WHERE /i\"",
",",
"$",
"query",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"tmp",
... | Get the condition part of the query. This is especially useful to
build a StringQuery from the query objects.
@return String | [
"Get",
"the",
"condition",
"part",
"of",
"the",
"query",
".",
"This",
"is",
"especially",
"useful",
"to",
"build",
"a",
"StringQuery",
"from",
"the",
"query",
"objects",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L260-L268 |
26,779 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.getParameters | protected function getParameters($criteria, array $parameters) {
$result = [];
// flatten conditions
$criteriaFlat = [];
foreach ($criteria as $key => $curCriteria) {
foreach ($curCriteria as $criterion) {
if ($criterion instanceof Criteria) {
$mapper = self::getMapper($criterion... | php | protected function getParameters($criteria, array $parameters) {
$result = [];
// flatten conditions
$criteriaFlat = [];
foreach ($criteria as $key => $curCriteria) {
foreach ($curCriteria as $criterion) {
if ($criterion instanceof Criteria) {
$mapper = self::getMapper($criterion... | [
"protected",
"function",
"getParameters",
"(",
"$",
"criteria",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"// flatten conditions",
"$",
"criteriaFlat",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"criteria",
"as",
"$",
"k... | Get an array of parameter values for the given criteria
@param $criteria An array of Criteria instances that define conditions on the object's attributes (maybe null)
@param $parameters Array defining the parameter order
@return Array | [
"Get",
"an",
"array",
"of",
"parameter",
"values",
"for",
"the",
"given",
"criteria"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L561-L597 |
26,780 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.processTableName | protected function processTableName(Node $tpl) {
$mapper = self::getMapper($tpl->getType());
$mapperTableName = $mapper->getRealTableName();
$tableName = $tpl->getProperty(self::PROPERTY_TABLE_NAME);
if ($tableName == null) {
$tableName = $mapperTableName;
// if the template is the child o... | php | protected function processTableName(Node $tpl) {
$mapper = self::getMapper($tpl->getType());
$mapperTableName = $mapper->getRealTableName();
$tableName = $tpl->getProperty(self::PROPERTY_TABLE_NAME);
if ($tableName == null) {
$tableName = $mapperTableName;
// if the template is the child o... | [
"protected",
"function",
"processTableName",
"(",
"Node",
"$",
"tpl",
")",
"{",
"$",
"mapper",
"=",
"self",
"::",
"getMapper",
"(",
"$",
"tpl",
"->",
"getType",
"(",
")",
")",
";",
"$",
"mapperTableName",
"=",
"$",
"mapper",
"->",
"getRealTableName",
"("... | Get the table name for the template and calculate an alias if
necessary.
@param $tpl The object template
@return Associative array with keys 'name', 'alias' | [
"Get",
"the",
"table",
"name",
"for",
"the",
"template",
"and",
"calculate",
"an",
"alias",
"if",
"necessary",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L629-L651 |
26,781 | iherwig/wcmf | src/wcmf/lib/model/ObjectQuery.php | ObjectQuery.valueChanged | public function valueChanged(ValueChangeEvent $event) {
$object = $event->getObject();
$name = $event->getValueName();
$initialOid = $object->getProperty(self::PROPERTY_INITIAL_OID);
if (isset($this->observedObjects[$initialOid])) {
$newValue = $event->getNewValue();
// make a criteria from ... | php | public function valueChanged(ValueChangeEvent $event) {
$object = $event->getObject();
$name = $event->getValueName();
$initialOid = $object->getProperty(self::PROPERTY_INITIAL_OID);
if (isset($this->observedObjects[$initialOid])) {
$newValue = $event->getNewValue();
// make a criteria from ... | [
"public",
"function",
"valueChanged",
"(",
"ValueChangeEvent",
"$",
"event",
")",
"{",
"$",
"object",
"=",
"$",
"event",
"->",
"getObject",
"(",
")",
";",
"$",
"name",
"=",
"$",
"event",
"->",
"getValueName",
"(",
")",
";",
"$",
"initialOid",
"=",
"$",... | Listen to ValueChangeEvents
@param $event ValueChangeEvent instance | [
"Listen",
"to",
"ValueChangeEvents"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/ObjectQuery.php#L657-L694 |
26,782 | skie/plum_search | src/FormParameter/ParameterRegistry.php | ParameterRegistry._resolveClassName | protected function _resolveClassName($class)
{
$result = App::className($class, 'FormParameter', 'Parameter');
if ($result || strpos($class, '.') !== false) {
return $result;
}
return App::className('PlumSearch.' . $class, 'FormParameter', 'Parameter');
} | php | protected function _resolveClassName($class)
{
$result = App::className($class, 'FormParameter', 'Parameter');
if ($result || strpos($class, '.') !== false) {
return $result;
}
return App::className('PlumSearch.' . $class, 'FormParameter', 'Parameter');
} | [
"protected",
"function",
"_resolveClassName",
"(",
"$",
"class",
")",
"{",
"$",
"result",
"=",
"App",
"::",
"className",
"(",
"$",
"class",
",",
"'FormParameter'",
",",
"'Parameter'",
")",
";",
"if",
"(",
"$",
"result",
"||",
"strpos",
"(",
"$",
"class",... | Resolve a param class name.
Part of the template method for Cake\Core\ObjectRegistry::load()
@param string $class Partial class name to resolve.
@return string|false Either the correct class name or false. | [
"Resolve",
"a",
"param",
"class",
"name",
"."
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/ParameterRegistry.php#L62-L70 |
26,783 | skie/plum_search | src/FormParameter/ParameterRegistry.php | ParameterRegistry.collection | public function collection($collectionMethod = null)
{
$collection = collection($this->_loaded);
if (is_callable($collectionMethod)) {
return $collectionMethod($collection);
}
return $collection;
} | php | public function collection($collectionMethod = null)
{
$collection = collection($this->_loaded);
if (is_callable($collectionMethod)) {
return $collectionMethod($collection);
}
return $collection;
} | [
"public",
"function",
"collection",
"(",
"$",
"collectionMethod",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"collection",
"(",
"$",
"this",
"->",
"_loaded",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"collectionMethod",
")",
")",
"{",
"return",
"... | Return collection of loaded parameters
@return \Cake\Collection\Collection | [
"Return",
"collection",
"of",
"loaded",
"parameters"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/ParameterRegistry.php#L115-L123 |
26,784 | skie/plum_search | src/FormParameter/ParameterRegistry.php | ParameterRegistry.data | public function data($name = null)
{
if ($this->_Controller->request->is('get')) {
if (empty($name)) {
return $this->_Controller->request->query;
} else {
return $this->_Controller->request->query($name);
}
} elseif ($this->_Control... | php | public function data($name = null)
{
if ($this->_Controller->request->is('get')) {
if (empty($name)) {
return $this->_Controller->request->query;
} else {
return $this->_Controller->request->query($name);
}
} elseif ($this->_Control... | [
"public",
"function",
"data",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_Controller",
"->",
"request",
"->",
"is",
"(",
"'get'",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"t... | Returns parameter value based by it's name
@param string $name Parameter name.
@return mixed | [
"Returns",
"parameter",
"value",
"based",
"by",
"it",
"s",
"name"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/ParameterRegistry.php#L131-L148 |
26,785 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.readInRelation | public function readInRelation() {
$request = $this->getRequest();
// rewrite query if querying for a relation
$relationName = $request->getValue('relation');
// set the query
$sourceOid = ObjectId::parse($request->getValue('sourceOid'));
$persistenceFacade = $this->getPersistenceFacade();
... | php | public function readInRelation() {
$request = $this->getRequest();
// rewrite query if querying for a relation
$relationName = $request->getValue('relation');
// set the query
$sourceOid = ObjectId::parse($request->getValue('sourceOid'));
$persistenceFacade = $this->getPersistenceFacade();
... | [
"public",
"function",
"readInRelation",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"// rewrite query if querying for a relation",
"$",
"relationName",
"=",
"$",
"request",
"->",
"getValue",
"(",
"'relation'",
")",
";",
... | Read objects that are related to another object
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the returned objects
| _in_ `sourceId` | Id of the object to which the returned objects are related (determines the object id together with _className_)
|... | [
"Read",
"objects",
"that",
"are",
"related",
"to",
"another",
"object"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L190-L225 |
26,786 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.create | public function create() {
$this->requireTransaction();
// delegate to SaveController
$subResponse = $this->executeSubAction('create');
// return object only
$oidStr = $subResponse->hasValue('oid') ? $subResponse->getValue('oid')->__toString() : null;
$this->handleSubResponse($subResponse, $oid... | php | public function create() {
$this->requireTransaction();
// delegate to SaveController
$subResponse = $this->executeSubAction('create');
// return object only
$oidStr = $subResponse->hasValue('oid') ? $subResponse->getValue('oid')->__toString() : null;
$this->handleSubResponse($subResponse, $oid... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"this",
"->",
"requireTransaction",
"(",
")",
";",
"// delegate to SaveController",
"$",
"subResponse",
"=",
"$",
"this",
"->",
"executeSubAction",
"(",
"'create'",
")",
";",
"// return object only",
"$",
"oidS... | Create an object of a given type
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the object
| _in_ `className` | Type of object to create
| _out_ | Created object data
The object data is contained in POST content. | [
"Create",
"an",
"object",
"of",
"a",
"given",
"type"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L238-L251 |
26,787 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.createInRelation | public function createInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
// create new object
$oidStr = null;
$sourceOid = ObjectId::parse($request->getValue('sourceOid'));
$relatedType = $this->getRelatedType($sourceOid, $request->getValue('relation'));
$request->s... | php | public function createInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
// create new object
$oidStr = null;
$sourceOid = ObjectId::parse($request->getValue('sourceOid'));
$relatedType = $this->getRelatedType($sourceOid, $request->getValue('relation'));
$request->s... | [
"public",
"function",
"createInRelation",
"(",
")",
"{",
"$",
"this",
"->",
"requireTransaction",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"// create new object",
"$",
"oidStr",
"=",
"null",
";",
"$",
"sourceOid",... | Create an object of a given type in the given relation
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the object
| _in_ `className` | Type of object to create
| _in_ `sourceId` | Id of the object to which the created objects are added (determines th... | [
"Create",
"an",
"object",
"of",
"a",
"given",
"type",
"in",
"the",
"given",
"relation"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L267-L304 |
26,788 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.update | public function update() {
$this->requireTransaction();
$request = $this->getRequest();
$oidStr = $this->getFirstRequestOid();
$isOrderRequest = $request->hasValue('referenceOid');
if ($isOrderRequest) {
// change order in all objects of the same type
$request->setValue('insertOid', $th... | php | public function update() {
$this->requireTransaction();
$request = $this->getRequest();
$oidStr = $this->getFirstRequestOid();
$isOrderRequest = $request->hasValue('referenceOid');
if ($isOrderRequest) {
// change order in all objects of the same type
$request->setValue('insertOid', $th... | [
"public",
"function",
"update",
"(",
")",
"{",
"$",
"this",
"->",
"requireTransaction",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"oidStr",
"=",
"$",
"this",
"->",
"getFirstRequestOid",
"(",
")",
";",
"$... | Update an object or change the order
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the object
| _in_ `className` | Type of object to update
| _in_ `id` | Id of object to update
| _out_ | Updated object data
The object data is cont... | [
"Update",
"an",
"object",
"or",
"change",
"the",
"order"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L318-L350 |
26,789 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.updateInRelation | public function updateInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
$isOrderRequest = $request->hasValue('referenceOid');
$request->setValue('role', $request->getValue('relation'));
if ($isOrderRequest) {
// change order in a relation
$request->setValue('co... | php | public function updateInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
$isOrderRequest = $request->hasValue('referenceOid');
$request->setValue('role', $request->getValue('relation'));
if ($isOrderRequest) {
// change order in a relation
$request->setValue('co... | [
"public",
"function",
"updateInRelation",
"(",
")",
"{",
"$",
"this",
"->",
"requireTransaction",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"isOrderRequest",
"=",
"$",
"request",
"->",
"hasValue",
"(",
"'ref... | Update an object in a relation or change the order
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the object
| _in_ `className` | Type of object to update
| _in_ `id` | Id of object to update
| _in_ `relation` | Relation name if an existing o... | [
"Update",
"an",
"object",
"in",
"a",
"relation",
"or",
"change",
"the",
"order"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L367-L409 |
26,790 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.deleteInRelation | public function deleteInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
// remove existing object from relation
$request->setValue('role', $request->getValue('relation'));
// delegate to AssociateController
$subResponse = $this->executeSubAction('disassociate');
... | php | public function deleteInRelation() {
$this->requireTransaction();
$request = $this->getRequest();
// remove existing object from relation
$request->setValue('role', $request->getValue('relation'));
// delegate to AssociateController
$subResponse = $this->executeSubAction('disassociate');
... | [
"public",
"function",
"deleteInRelation",
"(",
")",
"{",
"$",
"this",
"->",
"requireTransaction",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"// remove existing object from relation",
"$",
"request",
"->",
"setValue",
"... | Remove an object from a relation
| Parameter | Description
|------------------|-------------------------
| _in_ `language` | The language of the object
| _in_ `className` | Type of object to delete
| _in_ `id` | Id of object to delete
| _in_ `relation` | Name of the relation to the object defined by _s... | [
"Remove",
"an",
"object",
"from",
"a",
"relation"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L444-L459 |
26,791 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.handleSubResponse | protected function handleSubResponse(Response $subResponse, $oidStr=null) {
$response = $this->getResponse();
if (!$subResponse->hasErrors()) {
$response->clearValues();
$response->setHeaders($subResponse->getHeaders());
$response->setStatus($subResponse->getStatus());
if ($subResponse->... | php | protected function handleSubResponse(Response $subResponse, $oidStr=null) {
$response = $this->getResponse();
if (!$subResponse->hasErrors()) {
$response->clearValues();
$response->setHeaders($subResponse->getHeaders());
$response->setStatus($subResponse->getStatus());
if ($subResponse->... | [
"protected",
"function",
"handleSubResponse",
"(",
"Response",
"$",
"subResponse",
",",
"$",
"oidStr",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
";",
"if",
"(",
"!",
"$",
"subResponse",
"->",
"hasErrors",
"(... | Create the actual response from the response resulting from delegating to
another controller
@param $subResponse The response returned from the other controller
@param $oidStr Serialized object id of the object to return (optional)
@return Boolean whether an error occured or not | [
"Create",
"the",
"actual",
"response",
"from",
"the",
"response",
"resulting",
"from",
"delegating",
"to",
"another",
"controller"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L468-L498 |
26,792 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.setLocationHeaderFromOid | protected function setLocationHeaderFromOid($oidStr) {
$oid = ObjectId::parse($oidStr);
if ($oid) {
$response = $this->getResponse();
$response->setHeader('Location', $oidStr);
}
} | php | protected function setLocationHeaderFromOid($oidStr) {
$oid = ObjectId::parse($oidStr);
if ($oid) {
$response = $this->getResponse();
$response->setHeader('Location', $oidStr);
}
} | [
"protected",
"function",
"setLocationHeaderFromOid",
"(",
"$",
"oidStr",
")",
"{",
"$",
"oid",
"=",
"ObjectId",
"::",
"parse",
"(",
"$",
"oidStr",
")",
";",
"if",
"(",
"$",
"oid",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getResponse",
"(",
... | Set the location response header according to the given object id
@param $oidStr The serialized object id | [
"Set",
"the",
"location",
"response",
"header",
"according",
"to",
"the",
"given",
"object",
"id"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L528-L534 |
26,793 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.getFirstRequestOid | protected function getFirstRequestOid() {
$request = $this->getRequest();
foreach ($request->getValues() as $key => $value) {
if (ObjectId::isValid($key)) {
return $key;
}
}
return '';
} | php | protected function getFirstRequestOid() {
$request = $this->getRequest();
foreach ($request->getValues() as $key => $value) {
if (ObjectId::isValid($key)) {
return $key;
}
}
return '';
} | [
"protected",
"function",
"getFirstRequestOid",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"foreach",
"(",
"$",
"request",
"->",
"getValues",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",... | Get the first oid from the request
@return String | [
"Get",
"the",
"first",
"oid",
"from",
"the",
"request"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L540-L548 |
26,794 | iherwig/wcmf | src/wcmf/application/controller/RESTController.php | RESTController.getRelatedType | protected function getRelatedType(ObjectId $sourceOid, $role) {
$persistenceFacade = $this->getPersistenceFacade();
$sourceMapper = $persistenceFacade->getMapper($sourceOid->getType());
$relation = $sourceMapper->getRelation($role);
return $relation->getOtherType();
} | php | protected function getRelatedType(ObjectId $sourceOid, $role) {
$persistenceFacade = $this->getPersistenceFacade();
$sourceMapper = $persistenceFacade->getMapper($sourceOid->getType());
$relation = $sourceMapper->getRelation($role);
return $relation->getOtherType();
} | [
"protected",
"function",
"getRelatedType",
"(",
"ObjectId",
"$",
"sourceOid",
",",
"$",
"role",
")",
"{",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"$",
"sourceMapper",
"=",
"$",
"persistenceFacade",
"->",
"getMap... | Get the type that is used in the given role related to the
given source object.
@param $sourceOid ObjectId of the source object
@param $role The role name
@return String | [
"Get",
"the",
"type",
"that",
"is",
"used",
"in",
"the",
"given",
"role",
"related",
"to",
"the",
"given",
"source",
"object",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/RESTController.php#L557-L562 |
26,795 | heyday/silverstripe-versioneddataobjects | code/VersionedReadingMode.php | VersionedReadingMode.restoreOriginalReadingMode | public static function restoreOriginalReadingMode()
{
if (
isset(self::$originalReadingMode) &&
in_array(self::$originalReadingMode, array('Stage', 'Live'))
) {
Versioned::reading_stage(self::$originalReadingMode);
}
} | php | public static function restoreOriginalReadingMode()
{
if (
isset(self::$originalReadingMode) &&
in_array(self::$originalReadingMode, array('Stage', 'Live'))
) {
Versioned::reading_stage(self::$originalReadingMode);
}
} | [
"public",
"static",
"function",
"restoreOriginalReadingMode",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"originalReadingMode",
")",
"&&",
"in_array",
"(",
"self",
"::",
"$",
"originalReadingMode",
",",
"array",
"(",
"'Stage'",
",",
"'Live'",
... | Restore the reading mode to what's been set originally in the CMS | [
"Restore",
"the",
"reading",
"mode",
"to",
"what",
"s",
"been",
"set",
"originally",
"in",
"the",
"CMS"
] | 30a07d976abd17baba9d9194ca176c82d72323ac | https://github.com/heyday/silverstripe-versioneddataobjects/blob/30a07d976abd17baba9d9194ca176c82d72323ac/code/VersionedReadingMode.php#L39-L47 |
26,796 | iherwig/wcmf | src/wcmf/lib/model/output/DotOutputStrategy.php | DotOutputStrategy.isWritten | private function isWritten($node) {
$oidStr = $node->getOID()->__toString();
return (isset($this->writtenNodes[$oidStr]));
} | php | private function isWritten($node) {
$oidStr = $node->getOID()->__toString();
return (isset($this->writtenNodes[$oidStr]));
} | [
"private",
"function",
"isWritten",
"(",
"$",
"node",
")",
"{",
"$",
"oidStr",
"=",
"$",
"node",
"->",
"getOID",
"(",
")",
"->",
"__toString",
"(",
")",
";",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"writtenNodes",
"[",
"$",
"oidStr",
"]",
"... | Check if a node is written.
@param $node The node to check
@return Boolean | [
"Check",
"if",
"a",
"node",
"is",
"written",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/DotOutputStrategy.php#L130-L133 |
26,797 | iherwig/wcmf | src/wcmf/lib/model/output/DotOutputStrategy.php | DotOutputStrategy.getIndex | private function getIndex($node) {
$oidStr = $node->getOID()->__toString();
if (!isset($this->nodeIndexMap[$oidStr])) {
$this->nodeIndexMap[$oidStr] = $this->getNextIndex();
}
return $this->nodeIndexMap[$oidStr];
} | php | private function getIndex($node) {
$oidStr = $node->getOID()->__toString();
if (!isset($this->nodeIndexMap[$oidStr])) {
$this->nodeIndexMap[$oidStr] = $this->getNextIndex();
}
return $this->nodeIndexMap[$oidStr];
} | [
"private",
"function",
"getIndex",
"(",
"$",
"node",
")",
"{",
"$",
"oidStr",
"=",
"$",
"node",
"->",
"getOID",
"(",
")",
"->",
"__toString",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nodeIndexMap",
"[",
"$",
"oidStr",
"]",
... | Get the node index.
@param $node The node to get the index of
@return Number | [
"Get",
"the",
"node",
"index",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/output/DotOutputStrategy.php#L140-L146 |
26,798 | iherwig/wcmf | src/wcmf/lib/model/NodeSortkeyComparator.php | NodeSortkeyComparator.compare | public function compare(Node $a, Node $b) {
$valA = $this->getSortkeyValue($a);
$valB = $this->getSortkeyValue($b);
if ($valA == $valB) { return 0; }
return ($valA > $valB) ? 1 : -1;
} | php | public function compare(Node $a, Node $b) {
$valA = $this->getSortkeyValue($a);
$valB = $this->getSortkeyValue($b);
if ($valA == $valB) { return 0; }
return ($valA > $valB) ? 1 : -1;
} | [
"public",
"function",
"compare",
"(",
"Node",
"$",
"a",
",",
"Node",
"$",
"b",
")",
"{",
"$",
"valA",
"=",
"$",
"this",
"->",
"getSortkeyValue",
"(",
"$",
"a",
")",
";",
"$",
"valB",
"=",
"$",
"this",
"->",
"getSortkeyValue",
"(",
"$",
"b",
")",
... | Compare function for sorting Nodes in the given relation
@param $a First Node instance
@param $b First Node instance
@return -1, 0 or 1 whether a is less, equal or greater than b
in respect of the criteria | [
"Compare",
"function",
"for",
"sorting",
"Nodes",
"in",
"the",
"given",
"relation"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeSortkeyComparator.php#L63-L68 |
26,799 | iherwig/wcmf | src/wcmf/lib/model/NodeSortkeyComparator.php | NodeSortkeyComparator.getSortkeyValue | protected function getSortkeyValue(Node $node) {
// if no role is defined for a or b, the sortkey is
// determined from the type of the reference node
$defaultRole = $this->referenceNode->getType();
$referenceMapper = $this->referenceNode->getMapper();
$mapper = $node->getMapper();
if ($referen... | php | protected function getSortkeyValue(Node $node) {
// if no role is defined for a or b, the sortkey is
// determined from the type of the reference node
$defaultRole = $this->referenceNode->getType();
$referenceMapper = $this->referenceNode->getMapper();
$mapper = $node->getMapper();
if ($referen... | [
"protected",
"function",
"getSortkeyValue",
"(",
"Node",
"$",
"node",
")",
"{",
"// if no role is defined for a or b, the sortkey is",
"// determined from the type of the reference node",
"$",
"defaultRole",
"=",
"$",
"this",
"->",
"referenceNode",
"->",
"getType",
"(",
")"... | Get the sortkey value of a node in the given relation
@param $node Node
@return Number | [
"Get",
"the",
"sortkey",
"value",
"of",
"a",
"node",
"in",
"the",
"given",
"relation"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeSortkeyComparator.php#L75-L97 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.