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,600 | iherwig/wcmf | src/wcmf/lib/security/impl/StaticPermissionManager.php | StaticPermissionManager.getConfigurationInstance | protected function getConfigurationInstance() {
// get config file to modify
$configFiles = $this->configuration->getConfigurations();
if (sizeof($configFiles) == 0) {
return false;
}
// create a writable configuration and modify the permission
$mainConfig = $configFiles[0];
$config =... | php | protected function getConfigurationInstance() {
// get config file to modify
$configFiles = $this->configuration->getConfigurations();
if (sizeof($configFiles) == 0) {
return false;
}
// create a writable configuration and modify the permission
$mainConfig = $configFiles[0];
$config =... | [
"protected",
"function",
"getConfigurationInstance",
"(",
")",
"{",
"// get config file to modify",
"$",
"configFiles",
"=",
"$",
"this",
"->",
"configuration",
"->",
"getConfigurations",
"(",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"configFiles",
")",
"==",
"0... | Get the configuration instance and file that is used to store the permissions.
@return Associative array with keys 'instance' and 'file'. | [
"Get",
"the",
"configuration",
"instance",
"and",
"file",
"that",
"is",
"used",
"to",
"store",
"the",
"permissions",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/StaticPermissionManager.php#L157-L172 |
26,601 | iherwig/wcmf | src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php | PersistenceActionKeyProvider.getAllKeyValues | protected function getAllKeyValues() {
$keys = [];
// add temporary permission to allow to read entitys
$this->isLoadingKeys = true;
$permissionManager = ObjectFactory::getInstance('permissionManager');
$tmpPerm = $permissionManager->addTempPermission($this->entityType, '', PersistenceAction::READ);... | php | protected function getAllKeyValues() {
$keys = [];
// add temporary permission to allow to read entitys
$this->isLoadingKeys = true;
$permissionManager = ObjectFactory::getInstance('permissionManager');
$tmpPerm = $permissionManager->addTempPermission($this->entityType, '', PersistenceAction::READ);... | [
"protected",
"function",
"getAllKeyValues",
"(",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"// add temporary permission to allow to read entitys",
"$",
"this",
"->",
"isLoadingKeys",
"=",
"true",
";",
"$",
"permissionManager",
"=",
"ObjectFactory",
"::",
"getInstan... | Get all key values from the storage
@return Associative array with action keys as keys | [
"Get",
"all",
"key",
"values",
"from",
"the",
"storage"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php#L112-L131 |
26,602 | iherwig/wcmf | src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php | PersistenceActionKeyProvider.getSingleKeyValue | protected function getSingleKeyValue($actionKey) {
$query = new ObjectQuery($this->entityType, __CLASS__.__METHOD__);
$tpl = $query->getObjectTemplate($this->entityType);
$actionKeyParams = ActionKey::parseKey($actionKey);
$tpl->setValue($this->valueMap['resource'], Criteria::asValue('=', $actionKeyPara... | php | protected function getSingleKeyValue($actionKey) {
$query = new ObjectQuery($this->entityType, __CLASS__.__METHOD__);
$tpl = $query->getObjectTemplate($this->entityType);
$actionKeyParams = ActionKey::parseKey($actionKey);
$tpl->setValue($this->valueMap['resource'], Criteria::asValue('=', $actionKeyPara... | [
"protected",
"function",
"getSingleKeyValue",
"(",
"$",
"actionKey",
")",
"{",
"$",
"query",
"=",
"new",
"ObjectQuery",
"(",
"$",
"this",
"->",
"entityType",
",",
"__CLASS__",
".",
"__METHOD__",
")",
";",
"$",
"tpl",
"=",
"$",
"query",
"->",
"getObjectTemp... | Get a single key value from the storage
@param $actionKey The action key
@return String | [
"Get",
"a",
"single",
"key",
"value",
"from",
"the",
"storage"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php#L138-L150 |
26,603 | iherwig/wcmf | src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php | PersistenceActionKeyProvider.keyChanged | public function keyChanged(PersistenceEvent $event) {
$object = $event->getObject();
if ($object->getType() == $this->entityType) {
$cache = ObjectFactory::getInstance('dynamicCache');
$cache->clear($this->getId());
}
} | php | public function keyChanged(PersistenceEvent $event) {
$object = $event->getObject();
if ($object->getType() == $this->entityType) {
$cache = ObjectFactory::getInstance('dynamicCache');
$cache->clear($this->getId());
}
} | [
"public",
"function",
"keyChanged",
"(",
"PersistenceEvent",
"$",
"event",
")",
"{",
"$",
"object",
"=",
"$",
"event",
"->",
"getObject",
"(",
")",
";",
"if",
"(",
"$",
"object",
"->",
"getType",
"(",
")",
"==",
"$",
"this",
"->",
"entityType",
")",
... | Listen to PersistentEvent
@param $event PersistentEvent instance | [
"Listen",
"to",
"PersistentEvent"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/PersistenceActionKeyProvider.php#L156-L162 |
26,604 | iherwig/wcmf | src/wcmf/lib/service/impl/HTTPClient.php | HTTPClient.doLogin | protected function doLogin() {
if ($this->user) {
$request = ObjectFactory::getNewInstance('request');
$request->setAction('login');
$request->setValues([
'login' => $this->user['login'],
'password' => $this->user['password']
]);
$response = $this->doRemoteCall($request... | php | protected function doLogin() {
if ($this->user) {
$request = ObjectFactory::getNewInstance('request');
$request->setAction('login');
$request->setValues([
'login' => $this->user['login'],
'password' => $this->user['password']
]);
$response = $this->doRemoteCall($request... | [
"protected",
"function",
"doLogin",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"user",
")",
"{",
"$",
"request",
"=",
"ObjectFactory",
"::",
"getNewInstance",
"(",
"'request'",
")",
";",
"$",
"request",
"->",
"setAction",
"(",
"'login'",
")",
";",
"$... | Do the login request. If the request is successful,
the session id will be set.
@return True on success | [
"Do",
"the",
"login",
"request",
".",
"If",
"the",
"request",
"is",
"successful",
"the",
"session",
"id",
"will",
"be",
"set",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/impl/HTTPClient.php#L130-L147 |
26,605 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.copyNode | protected function copyNode(ObjectId $oid) {
$logger = $this->getLogger();
if ($logger->isDebugEnabled()) {
$logger->debug("Copying node ".$oid);
}
$persistenceFacade = $this->getPersistenceFacade();
// load the original node
$node = $persistenceFacade->load($oid);
if ($node == null) ... | php | protected function copyNode(ObjectId $oid) {
$logger = $this->getLogger();
if ($logger->isDebugEnabled()) {
$logger->debug("Copying node ".$oid);
}
$persistenceFacade = $this->getPersistenceFacade();
// load the original node
$node = $persistenceFacade->load($oid);
if ($node == null) ... | [
"protected",
"function",
"copyNode",
"(",
"ObjectId",
"$",
"oid",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"if",
"(",
"$",
"logger",
"->",
"isDebugEnabled",
"(",
")",
")",
"{",
"$",
"logger",
"->",
"debug",
"(",
... | Create a copy of the node with the given object id. The returned
node is already persisted.
@param $oid The object id of the node to copy
@return The copied Node or null | [
"Create",
"a",
"copy",
"of",
"the",
"node",
"with",
"the",
"given",
"object",
"id",
".",
"The",
"returned",
"node",
"is",
"already",
"persisted",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L355-L409 |
26,606 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.getTargetNode | protected function getTargetNode(ObjectId $targetOID) {
if ($this->targetNode == null) {
// load parent node
$persistenceFacade = $this->getPersistenceFacade();
$targetNode = $persistenceFacade->load($targetOID);
$this->targetNode = $targetNode;
}
return $this->targetNode;
} | php | protected function getTargetNode(ObjectId $targetOID) {
if ($this->targetNode == null) {
// load parent node
$persistenceFacade = $this->getPersistenceFacade();
$targetNode = $persistenceFacade->load($targetOID);
$this->targetNode = $targetNode;
}
return $this->targetNode;
} | [
"protected",
"function",
"getTargetNode",
"(",
"ObjectId",
"$",
"targetOID",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"targetNode",
"==",
"null",
")",
"{",
"// load parent node",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")"... | Get the target node from the request parameter targetoid
@param $targetOID The object id of the target node
@return Node instance | [
"Get",
"the",
"target",
"node",
"from",
"the",
"request",
"parameter",
"targetoid"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L427-L435 |
26,607 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.registerCopy | protected function registerCopy(PersistentObject $origNode, PersistentObject $copyNode) {
// store oid in the registry
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
$registry[$origNode->getOID()->__toString()] = $copyNode->getOID()->__toString();
$this->setLocalSessionValue(self::OBJECT... | php | protected function registerCopy(PersistentObject $origNode, PersistentObject $copyNode) {
// store oid in the registry
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
$registry[$origNode->getOID()->__toString()] = $copyNode->getOID()->__toString();
$this->setLocalSessionValue(self::OBJECT... | [
"protected",
"function",
"registerCopy",
"(",
"PersistentObject",
"$",
"origNode",
",",
"PersistentObject",
"$",
"copyNode",
")",
"{",
"// store oid in the registry",
"$",
"registry",
"=",
"$",
"this",
"->",
"getLocalSessionValue",
"(",
"self",
"::",
"OBJECT_MAP_VAR",... | Register a copied node in the session for later reference
@param $origNode The original Node instance
@param $copyNode The copied Node instance | [
"Register",
"a",
"copied",
"node",
"in",
"the",
"session",
"for",
"later",
"reference"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L442-L447 |
26,608 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.updateCopyOIDs | protected function updateCopyOIDs(array $oidMap) {
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
// registry maybe deleted already if it's the last step
if ($registry) {
$flippedRegistry = array_flip($registry);
foreach ($oidMap as $oldOid => $newOid) {
if (isset($flippe... | php | protected function updateCopyOIDs(array $oidMap) {
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
// registry maybe deleted already if it's the last step
if ($registry) {
$flippedRegistry = array_flip($registry);
foreach ($oidMap as $oldOid => $newOid) {
if (isset($flippe... | [
"protected",
"function",
"updateCopyOIDs",
"(",
"array",
"$",
"oidMap",
")",
"{",
"$",
"registry",
"=",
"$",
"this",
"->",
"getLocalSessionValue",
"(",
"self",
"::",
"OBJECT_MAP_VAR",
")",
";",
"// registry maybe deleted already if it's the last step",
"if",
"(",
"$... | Update the copied object ids in the registry
@param $oidMap Map of changed object ids (key: old value, value: new value) | [
"Update",
"the",
"copied",
"object",
"ids",
"in",
"the",
"registry"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L453-L468 |
26,609 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.getCopyOID | protected function getCopyOID(ObjectId $origOID) {
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
// check if the oid exists in the registry
$oidStr = $origOID->__toString();
if (!isset($registry[$oidStr])) {
$logger = $this->getLogger();
if ($logger->isDebugEnabled()) {
... | php | protected function getCopyOID(ObjectId $origOID) {
$registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
// check if the oid exists in the registry
$oidStr = $origOID->__toString();
if (!isset($registry[$oidStr])) {
$logger = $this->getLogger();
if ($logger->isDebugEnabled()) {
... | [
"protected",
"function",
"getCopyOID",
"(",
"ObjectId",
"$",
"origOID",
")",
"{",
"$",
"registry",
"=",
"$",
"this",
"->",
"getLocalSessionValue",
"(",
"self",
"::",
"OBJECT_MAP_VAR",
")",
";",
"// check if the oid exists in the registry",
"$",
"oidStr",
"=",
"$",... | Get the object id of the copied node for a node id
@param $origOID The object id of the original node
@return ObjectId or null, if it does not exist already | [
"Get",
"the",
"object",
"id",
"of",
"the",
"copied",
"node",
"for",
"a",
"node",
"id"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L475-L490 |
26,610 | iherwig/wcmf | src/wcmf/application/controller/CopyController.php | CopyController.getCopy | protected function getCopy(ObjectId $origOID) {
$copyOID = $this->getCopyOID($origOID);
if ($copyOID != null) {
$persistenceFacade = $this->getPersistenceFacade();
$nodeCopy = $persistenceFacade->load($copyOID);
return $nodeCopy;
}
else {
return null;
}
} | php | protected function getCopy(ObjectId $origOID) {
$copyOID = $this->getCopyOID($origOID);
if ($copyOID != null) {
$persistenceFacade = $this->getPersistenceFacade();
$nodeCopy = $persistenceFacade->load($copyOID);
return $nodeCopy;
}
else {
return null;
}
} | [
"protected",
"function",
"getCopy",
"(",
"ObjectId",
"$",
"origOID",
")",
"{",
"$",
"copyOID",
"=",
"$",
"this",
"->",
"getCopyOID",
"(",
"$",
"origOID",
")",
";",
"if",
"(",
"$",
"copyOID",
"!=",
"null",
")",
"{",
"$",
"persistenceFacade",
"=",
"$",
... | Get the copied node for a node id
@param $origOID The object id of the original node
@return Copied Node or null, if it does not exist already | [
"Get",
"the",
"copied",
"node",
"for",
"a",
"node",
"id"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/CopyController.php#L497-L507 |
26,611 | iherwig/wcmf | src/wcmf/lib/search/impl/LuceneSearch.php | LuceneSearch.setIndexPath | public function setIndexPath($indexPath) {
$fileUtil = new FileUtil();
$this->indexPath = $fileUtil->realpath(WCMF_BASE.$indexPath).'/';
$fileUtil->mkdirRec($this->indexPath);
if (!is_writeable($this->indexPath)) {
throw new ConfigurationException("Index path '".$indexPath."' is not writeable.");
... | php | public function setIndexPath($indexPath) {
$fileUtil = new FileUtil();
$this->indexPath = $fileUtil->realpath(WCMF_BASE.$indexPath).'/';
$fileUtil->mkdirRec($this->indexPath);
if (!is_writeable($this->indexPath)) {
throw new ConfigurationException("Index path '".$indexPath."' is not writeable.");
... | [
"public",
"function",
"setIndexPath",
"(",
"$",
"indexPath",
")",
"{",
"$",
"fileUtil",
"=",
"new",
"FileUtil",
"(",
")",
";",
"$",
"this",
"->",
"indexPath",
"=",
"$",
"fileUtil",
"->",
"realpath",
"(",
"WCMF_BASE",
".",
"$",
"indexPath",
")",
".",
"'... | Set the path to the search index.
@param $indexPath Directory relative to main | [
"Set",
"the",
"path",
"to",
"the",
"search",
"index",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/search/impl/LuceneSearch.php#L88-L98 |
26,612 | iherwig/wcmf | src/wcmf/lib/search/impl/LuceneSearch.php | LuceneSearch.afterCommit | public function afterCommit(TransactionEvent $event) {
if ($this->liveUpdate && $event->getPhase() == TransactionEvent::AFTER_COMMIT) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
// add inserted/updated objects
foreach (array_merge(array_values($event->getInsertedOids())... | php | public function afterCommit(TransactionEvent $event) {
if ($this->liveUpdate && $event->getPhase() == TransactionEvent::AFTER_COMMIT) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
// add inserted/updated objects
foreach (array_merge(array_values($event->getInsertedOids())... | [
"public",
"function",
"afterCommit",
"(",
"TransactionEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"liveUpdate",
"&&",
"$",
"event",
"->",
"getPhase",
"(",
")",
"==",
"TransactionEvent",
"::",
"AFTER_COMMIT",
")",
"{",
"$",
"persistenceFacad... | Listen to TransactionEvents
@param $event TransactionEvent instance | [
"Listen",
"to",
"TransactionEvents"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/search/impl/LuceneSearch.php#L310-L328 |
26,613 | iherwig/wcmf | src/wcmf/lib/search/impl/LuceneSearch.php | LuceneSearch.getIndex | private function getIndex($create = true) {
if (!$this->index || $create) {
$indexPath = $this->getIndexPath();
$analyzer = new LuceneUtf8Analyzer();
// add stop words filter
$stopWords = $this->getStopWords();
$stopWordsFilter = new StopWords($stopWords);
$analyzer->addFilter(... | php | private function getIndex($create = true) {
if (!$this->index || $create) {
$indexPath = $this->getIndexPath();
$analyzer = new LuceneUtf8Analyzer();
// add stop words filter
$stopWords = $this->getStopWords();
$stopWordsFilter = new StopWords($stopWords);
$analyzer->addFilter(... | [
"private",
"function",
"getIndex",
"(",
"$",
"create",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"index",
"||",
"$",
"create",
")",
"{",
"$",
"indexPath",
"=",
"$",
"this",
"->",
"getIndexPath",
"(",
")",
";",
"$",
"analyzer",
"=",
... | Get the search index.
@param $create Boolean whether to create the index, if it does not exist (default: _true_)
@return An instance of ZendSearch/SearchIndexInterface or null | [
"Get",
"the",
"search",
"index",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/search/impl/LuceneSearch.php#L335-L361 |
26,614 | GW2Treasures/gw2api | src/V2/Endpoint/Continent/RegionEndpoint.php | RegionEndpoint.mapsOf | public function mapsOf( $region ) {
return new MapEndpoint( $this->api, $this->continent, $this->floor, $region );
} | php | public function mapsOf( $region ) {
return new MapEndpoint( $this->api, $this->continent, $this->floor, $region );
} | [
"public",
"function",
"mapsOf",
"(",
"$",
"region",
")",
"{",
"return",
"new",
"MapEndpoint",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"continent",
",",
"$",
"this",
"->",
"floor",
",",
"$",
"region",
")",
";",
"}"
] | Get the regions maps.
@param int $region
@return MapEndpoint | [
"Get",
"the",
"regions",
"maps",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Endpoint/Continent/RegionEndpoint.php#L47-L49 |
26,615 | iherwig/wcmf | src/wcmf/lib/presentation/link/LinkProcessor.php | LinkProcessor.processLinks | public static function processLinks($node, $base, LinkProcessorStrategy $strategy,
$recursive=true) {
if (!$node) {
return;
}
$invalidURLs = [];
$logger = LogManager::getLogger(__CLASS__);
// iterate over all node values
$iter = new NodeValueIterator($node, $recursive);
for(... | php | public static function processLinks($node, $base, LinkProcessorStrategy $strategy,
$recursive=true) {
if (!$node) {
return;
}
$invalidURLs = [];
$logger = LogManager::getLogger(__CLASS__);
// iterate over all node values
$iter = new NodeValueIterator($node, $recursive);
for(... | [
"public",
"static",
"function",
"processLinks",
"(",
"$",
"node",
",",
"$",
"base",
",",
"LinkProcessorStrategy",
"$",
"strategy",
",",
"$",
"recursive",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"return",
";",
"}",
"$",
"invalidURL... | Check and convert links in the given node.
@param $node Node instance
@param $base The base url of relative links as seen from the executing script
@param $strategy The strategy used to check and create urls
@param recursive Boolean whether to process child nodes to (default: true)
@return Array of invalid urls | [
"Check",
"and",
"convert",
"links",
"in",
"the",
"given",
"node",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/link/LinkProcessor.php#L39-L106 |
26,616 | iherwig/wcmf | src/wcmf/lib/presentation/link/LinkProcessor.php | LinkProcessor.replaceUrl | protected static function replaceUrl($value, $url, $urlConv, $type) {
if ($type == 'embedded') {
$value = str_replace('"'.$url.'"', '"'.$urlConv.'"', $value);
}
else {
$value = str_replace($url, $urlConv, $value);
}
return $value;
} | php | protected static function replaceUrl($value, $url, $urlConv, $type) {
if ($type == 'embedded') {
$value = str_replace('"'.$url.'"', '"'.$urlConv.'"', $value);
}
else {
$value = str_replace($url, $urlConv, $value);
}
return $value;
} | [
"protected",
"static",
"function",
"replaceUrl",
"(",
"$",
"value",
",",
"$",
"url",
",",
"$",
"urlConv",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'embedded'",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"'\"'",
".",
"$",
"ur... | Replace the url in the given value
@param $value
@param $url
@param $urlConv
@param $type embedded or direct
@return String | [
"Replace",
"the",
"url",
"in",
"the",
"given",
"value"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/link/LinkProcessor.php#L116-L124 |
26,617 | iherwig/wcmf | src/wcmf/lib/presentation/link/LinkProcessor.php | LinkProcessor.convertInternalLink | protected static function convertInternalLink($url, LinkProcessorStrategy $strategy) {
$urlConv = $url;
if (InternalLink::isLink($url)) {
$oid = InternalLink::getReferencedOID($url);
if ($oid != null) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$object = $... | php | protected static function convertInternalLink($url, LinkProcessorStrategy $strategy) {
$urlConv = $url;
if (InternalLink::isLink($url)) {
$oid = InternalLink::getReferencedOID($url);
if ($oid != null) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$object = $... | [
"protected",
"static",
"function",
"convertInternalLink",
"(",
"$",
"url",
",",
"LinkProcessorStrategy",
"$",
"strategy",
")",
"{",
"$",
"urlConv",
"=",
"$",
"url",
";",
"if",
"(",
"InternalLink",
"::",
"isLink",
"(",
"$",
"url",
")",
")",
"{",
"$",
"oid... | Convert an internal link.
@param $url The url to convert
@param $strategy The strategy used to check and create urls
@return The converted url | [
"Convert",
"an",
"internal",
"link",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/link/LinkProcessor.php#L171-L201 |
26,618 | iherwig/wcmf | src/wcmf/lib/service/SoapClient.php | SoapClient.call | public function call($method, $params=[]) {
$header = $this->generateWSSecurityHeader($this->user, $this->password);
$response = $this->__soapCall($method, sizeof($params) > 0 ? [$params] : [], null, $header);
// in document/literal style the "return" parameter holds the result
return property_exists($r... | php | public function call($method, $params=[]) {
$header = $this->generateWSSecurityHeader($this->user, $this->password);
$response = $this->__soapCall($method, sizeof($params) > 0 ? [$params] : [], null, $header);
// in document/literal style the "return" parameter holds the result
return property_exists($r... | [
"public",
"function",
"call",
"(",
"$",
"method",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"generateWSSecurityHeader",
"(",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
")",
";",
"$",
"re... | Call the given soap method
@param $method
@param $params (optional, default: empty array) | [
"Call",
"the",
"given",
"soap",
"method"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapClient.php#L50-L55 |
26,619 | iherwig/wcmf | src/wcmf/lib/service/SoapClient.php | SoapClient.__doRequest | public function __doRequest($request, $location, $action, $version, $oneway=0){
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Request:");
self::$logger->debug($request);
}
$response = trim(parent::__doRequest($request, $location, $action, $version, $oneway));
if (s... | php | public function __doRequest($request, $location, $action, $version, $oneway=0){
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Request:");
self::$logger->debug($request);
}
$response = trim(parent::__doRequest($request, $location, $action, $version, $oneway));
if (s... | [
"public",
"function",
"__doRequest",
"(",
"$",
"request",
",",
"$",
"location",
",",
"$",
"action",
",",
"$",
"version",
",",
"$",
"oneway",
"=",
"0",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
"->",
"isDebugEnabled",
"(",
")",
")",
"{",
"se... | Overridden in order to strip bom characters
@see SoapClient::__doRequest | [
"Overridden",
"in",
"order",
"to",
"strip",
"bom",
"characters"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapClient.php#L61-L78 |
26,620 | iherwig/wcmf | src/wcmf/lib/service/SoapClient.php | SoapClient.generateWSSecurityHeader | private function generateWSSecurityHeader($user, $password) {
$nonce = sha1(mt_rand());
$xml = '<wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="'.self::OASIS.'/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>'.$user.'</wsse:Username>
<wsse:Pass... | php | private function generateWSSecurityHeader($user, $password) {
$nonce = sha1(mt_rand());
$xml = '<wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="'.self::OASIS.'/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>'.$user.'</wsse:Username>
<wsse:Pass... | [
"private",
"function",
"generateWSSecurityHeader",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"$",
"nonce",
"=",
"sha1",
"(",
"mt_rand",
"(",
")",
")",
";",
"$",
"xml",
"=",
"'<wsse:Security SOAP-ENV:mustUnderstand=\"1\" xmlns:wsse=\"'",
".",
"self",
"::"... | Create the WS-Security authentication header for the given credentials
@param $user
@param $password
@return SoapHeader | [
"Create",
"the",
"WS",
"-",
"Security",
"authentication",
"header",
"for",
"the",
"given",
"credentials"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapClient.php#L86-L96 |
26,621 | iherwig/wcmf | src/wcmf/lib/service/SoapClient.php | SoapClient.getDebugInfos | public function getDebugInfos() {
$requestHeaders = $this->__getLastRequestHeaders();
$request = $this->__getLastRequest();
$responseHeaders = $this->__getLastResponseHeaders();
$response = $this->__getLastResponse();
$msg = '';
$msg .= "Request Headers:\n" . $requestHeaders . "\n";
$msg .=... | php | public function getDebugInfos() {
$requestHeaders = $this->__getLastRequestHeaders();
$request = $this->__getLastRequest();
$responseHeaders = $this->__getLastResponseHeaders();
$response = $this->__getLastResponse();
$msg = '';
$msg .= "Request Headers:\n" . $requestHeaders . "\n";
$msg .=... | [
"public",
"function",
"getDebugInfos",
"(",
")",
"{",
"$",
"requestHeaders",
"=",
"$",
"this",
"->",
"__getLastRequestHeaders",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"__getLastRequest",
"(",
")",
";",
"$",
"responseHeaders",
"=",
"$",
"thi... | Get informations about the last request. Available
if constructor options contain 'trace' => 1
@return String | [
"Get",
"informations",
"about",
"the",
"last",
"request",
".",
"Available",
"if",
"constructor",
"options",
"contain",
"trace",
"=",
">",
"1"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapClient.php#L103-L116 |
26,622 | heyday/silverstripe-versioneddataobjects | code/VersionedDataObjectDetailsForm.php | VersionedDataObjectDetailsForm_ItemRequest.doSaveAndQuit | public function doSaveAndQuit($data, $form)
{
$this->save($data, $form);
$controller = $this->getToplevelController();
$controller->getResponse()->addHeader("X-Pjax", "Content");
$controller->redirect($this->getBackLink());
} | php | public function doSaveAndQuit($data, $form)
{
$this->save($data, $form);
$controller = $this->getToplevelController();
$controller->getResponse()->addHeader("X-Pjax", "Content");
$controller->redirect($this->getBackLink());
} | [
"public",
"function",
"doSaveAndQuit",
"(",
"$",
"data",
",",
"$",
"form",
")",
"{",
"$",
"this",
"->",
"save",
"(",
"$",
"data",
",",
"$",
"form",
")",
";",
"$",
"controller",
"=",
"$",
"this",
"->",
"getToplevelController",
"(",
")",
";",
"$",
"c... | Override the doSaveAnQuit action from better buttons so that it uses the versioned way fo saving things.
@param $data
@param $form | [
"Override",
"the",
"doSaveAnQuit",
"action",
"from",
"better",
"buttons",
"so",
"that",
"it",
"uses",
"the",
"versioned",
"way",
"fo",
"saving",
"things",
"."
] | 30a07d976abd17baba9d9194ca176c82d72323ac | https://github.com/heyday/silverstripe-versioneddataobjects/blob/30a07d976abd17baba9d9194ca176c82d72323ac/code/VersionedDataObjectDetailsForm.php#L275-L281 |
26,623 | silverstripe/silverstripe-dynamodb | code/Model/DynamoDbSession.php | DynamoDbSession.get | public static function get()
{
// Use DynamoDB for distributed session storage if it's configured
$awsDynamoDBSessionTable = Environment::getEnv('AWS_DYNAMODB_SESSION_TABLE');
if (!empty($awsDynamoDBSessionTable)) {
$awsRegionName = Environment::getEnv('AWS_REGION_NAME');
... | php | public static function get()
{
// Use DynamoDB for distributed session storage if it's configured
$awsDynamoDBSessionTable = Environment::getEnv('AWS_DYNAMODB_SESSION_TABLE');
if (!empty($awsDynamoDBSessionTable)) {
$awsRegionName = Environment::getEnv('AWS_REGION_NAME');
... | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"// Use DynamoDB for distributed session storage if it's configured",
"$",
"awsDynamoDBSessionTable",
"=",
"Environment",
"::",
"getEnv",
"(",
"'AWS_DYNAMODB_SESSION_TABLE'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"... | Get an instance of DynamoDbSession configured from the environment if available.
@return null|DynamoDbSession | [
"Get",
"an",
"instance",
"of",
"DynamoDbSession",
"configured",
"from",
"the",
"environment",
"if",
"available",
"."
] | 785c69771b37636515f6a3b0015d04eab1585ca8 | https://github.com/silverstripe/silverstripe-dynamodb/blob/785c69771b37636515f6a3b0015d04eab1585ca8/code/Model/DynamoDbSession.php#L45-L77 |
26,624 | skie/plum_search | src/Model/Filter/AbstractFilter.php | AbstractFilter.apply | public function apply(Query $query, array $data)
{
if ($this->_applicable($data)) {
$field = $this->config('field');
if (is_string($field) && (strpos($field, '.') === false)) {
$field = $query->repository()->alias() . '.' . $field;
}
return $t... | php | public function apply(Query $query, array $data)
{
if ($this->_applicable($data)) {
$field = $this->config('field');
if (is_string($field) && (strpos($field, '.') === false)) {
$field = $query->repository()->alias() . '.' . $field;
}
return $t... | [
"public",
"function",
"apply",
"(",
"Query",
"$",
"query",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_applicable",
"(",
"$",
"data",
")",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"config",
"(",
"'field'",
")",
";"... | Apply filter to query based on filter data
@param \Cake\ORM\Query $query Query.
@param array $data Filters values.
@return \Cake\ORM\Query | [
"Apply",
"filter",
"to",
"query",
"based",
"on",
"filter",
"data"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/Filter/AbstractFilter.php#L63-L75 |
26,625 | skie/plum_search | src/Model/Filter/AbstractFilter.php | AbstractFilter._applicable | protected function _applicable($data)
{
$field = $this->config('name');
return $field && (!empty($data[$field]) || $this->_defaultDefined() || isset($data[$field]) && (string)$data[$field] !== '');
} | php | protected function _applicable($data)
{
$field = $this->config('name');
return $field && (!empty($data[$field]) || $this->_defaultDefined() || isset($data[$field]) && (string)$data[$field] !== '');
} | [
"protected",
"function",
"_applicable",
"(",
"$",
"data",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"config",
"(",
"'name'",
")",
";",
"return",
"$",
"field",
"&&",
"(",
"!",
"empty",
"(",
"$",
"data",
"[",
"$",
"field",
"]",
")",
"||",
"$"... | Check if filter applicable to query based on filter data
@param array $data Array of options as described above.
@return bool | [
"Check",
"if",
"filter",
"applicable",
"to",
"query",
"based",
"on",
"filter",
"data"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/Filter/AbstractFilter.php#L83-L88 |
26,626 | skie/plum_search | src/Model/Filter/AbstractFilter.php | AbstractFilter._value | protected function _value($data)
{
$field = $this->config('name');
$value = $data[$field];
if (empty($value) && $this->_defaultDefined()) {
$value = $this->config('default');
}
return $value;
} | php | protected function _value($data)
{
$field = $this->config('name');
$value = $data[$field];
if (empty($value) && $this->_defaultDefined()) {
$value = $this->config('default');
}
return $value;
} | [
"protected",
"function",
"_value",
"(",
"$",
"data",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"config",
"(",
"'name'",
")",
";",
"$",
"value",
"=",
"$",
"data",
"[",
"$",
"field",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
"&&... | Evaluate value of filter parameter
@param array $data Array of options as described above.
@return mixed | [
"Evaluate",
"value",
"of",
"filter",
"parameter"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/Model/Filter/AbstractFilter.php#L119-L128 |
26,627 | vufind-org/vufindharvest | src/OaiPmh/Communicator.php | Communicator.sendRequest | protected function sendRequest($verb, $params)
{
// Set up the request:
$this->client->resetParameters(false, false); // keep cookies/auth
$this->client->setUri($this->baseUrl);
// Load request parameters:
$query = $this->client->getRequest()->getQuery();
$query->set... | php | protected function sendRequest($verb, $params)
{
// Set up the request:
$this->client->resetParameters(false, false); // keep cookies/auth
$this->client->setUri($this->baseUrl);
// Load request parameters:
$query = $this->client->getRequest()->getQuery();
$query->set... | [
"protected",
"function",
"sendRequest",
"(",
"$",
"verb",
",",
"$",
"params",
")",
"{",
"// Set up the request:",
"$",
"this",
"->",
"client",
"->",
"resetParameters",
"(",
"false",
",",
"false",
")",
";",
"// keep cookies/auth",
"$",
"this",
"->",
"client",
... | Perform a single OAI-PMH request.
@param string $verb OAI-PMH verb to execute.
@param array $params GET parameters for ListRecords method.
@return string | [
"Perform",
"a",
"single",
"OAI",
"-",
"PMH",
"request",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Communicator.php#L92-L107 |
26,628 | vufind-org/vufindharvest | src/OaiPmh/Communicator.php | Communicator.getOaiResponse | protected function getOaiResponse($verb, $params)
{
// Debug:
$this->write(
"Sending request: verb = {$verb}, params = " . print_r($params, true)
);
// Set up retry loop:
do {
$result = $this->sendRequest($verb, $params);
if ($result->getS... | php | protected function getOaiResponse($verb, $params)
{
// Debug:
$this->write(
"Sending request: verb = {$verb}, params = " . print_r($params, true)
);
// Set up retry loop:
do {
$result = $this->sendRequest($verb, $params);
if ($result->getS... | [
"protected",
"function",
"getOaiResponse",
"(",
"$",
"verb",
",",
"$",
"params",
")",
"{",
"// Debug:",
"$",
"this",
"->",
"write",
"(",
"\"Sending request: verb = {$verb}, params = \"",
".",
"print_r",
"(",
"$",
"params",
",",
"true",
")",
")",
";",
"// Set u... | Make an OAI-PMH request. Throw an exception if there is an error; return
an XML string on success.
@param string $verb OAI-PMH verb to execute.
@param array $params GET parameters for ListRecords method.
@return string | [
"Make",
"an",
"OAI",
"-",
"PMH",
"request",
".",
"Throw",
"an",
"exception",
"if",
"there",
"is",
"an",
"error",
";",
"return",
"an",
"XML",
"string",
"on",
"success",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Communicator.php#L118-L145 |
26,629 | vufind-org/vufindharvest | src/OaiPmh/Communicator.php | Communicator.request | public function request($verb, $params = [])
{
$xml = $this->getOaiResponse($verb, $params);
return $this->responseProcessor
? $this->responseProcessor->process($xml) : $xml;
} | php | public function request($verb, $params = [])
{
$xml = $this->getOaiResponse($verb, $params);
return $this->responseProcessor
? $this->responseProcessor->process($xml) : $xml;
} | [
"public",
"function",
"request",
"(",
"$",
"verb",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"xml",
"=",
"$",
"this",
"->",
"getOaiResponse",
"(",
"$",
"verb",
",",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"responseProcessor",
... | Make an OAI-PMH request. Throw an exception if there is an error; return
the processed response on success.
@param string $verb OAI-PMH verb to execute.
@param array $params GET parameters for ListRecords method.
@return mixed | [
"Make",
"an",
"OAI",
"-",
"PMH",
"request",
".",
"Throw",
"an",
"exception",
"if",
"there",
"is",
"an",
"error",
";",
"return",
"the",
"processed",
"response",
"on",
"success",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Communicator.php#L156-L161 |
26,630 | GW2Treasures/gw2api | src/V2/ApiResponse.php | ApiResponse.json | public function json( array $config = [] ) {
$options = isset($config['big_int_strings']) ? JSON_BIGINT_AS_STRING : 0;
return json_decode($this->response->getBody(), false, 512, $options);
} | php | public function json( array $config = [] ) {
$options = isset($config['big_int_strings']) ? JSON_BIGINT_AS_STRING : 0;
return json_decode($this->response->getBody(), false, 512, $options);
} | [
"public",
"function",
"json",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"isset",
"(",
"$",
"config",
"[",
"'big_int_strings'",
"]",
")",
"?",
"JSON_BIGINT_AS_STRING",
":",
"0",
";",
"return",
"json_decode",
"(",
"$",
"t... | Get the response as json object.
@param array $config
@return mixed | [
"Get",
"the",
"response",
"as",
"json",
"object",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/ApiResponse.php#L30-L33 |
26,631 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.setConnectionParams | public function setConnectionParams($params) {
$this->connectionParams = $params;
if (isset($this->connectionParams['dbPrefix'])) {
$this->dbPrefix = $this->connectionParams['dbPrefix'];
}
} | php | public function setConnectionParams($params) {
$this->connectionParams = $params;
if (isset($this->connectionParams['dbPrefix'])) {
$this->dbPrefix = $this->connectionParams['dbPrefix'];
}
} | [
"public",
"function",
"setConnectionParams",
"(",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"connectionParams",
"=",
"$",
"params",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"connectionParams",
"[",
"'dbPrefix'",
"]",
")",
")",
"{",
"$",
"this",... | Set the connection parameters.
@param $params Initialization data given in an associative array with the following keys:
dbType, dbHostName, dbUserName, dbPassword, dbName
if dbPrefix is given it will be appended to every table string, which is
useful if different applications operate on the same database | [
"Set",
"the",
"connection",
"parameters",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L132-L137 |
26,632 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.getMapper | protected static function getMapper($type, $strict=true) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$mapper = $persistenceFacade->getMapper($type);
if ($strict && !($mapper instanceof RDBMapper)) {
throw new PersistenceException('Only PersistenceMappers of type RDBMapper a... | php | protected static function getMapper($type, $strict=true) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$mapper = $persistenceFacade->getMapper($type);
if ($strict && !($mapper instanceof RDBMapper)) {
throw new PersistenceException('Only PersistenceMappers of type RDBMapper a... | [
"protected",
"static",
"function",
"getMapper",
"(",
"$",
"type",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"$",
"persistenceFacade",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'persistenceFacade'",
")",
";",
"$",
"mapper",
"=",
"$",
"persistenceFacade"... | Get the mapper for a Node and optionally check if it is a supported one.
@param $type The type of Node to get the mapper for
@param $strict Boolean indicating if the mapper must be an instance of RDBMapper (default true)
@return RDBMapper instance | [
"Get",
"the",
"mapper",
"for",
"a",
"Node",
"and",
"optionally",
"check",
"if",
"it",
"is",
"a",
"supported",
"one",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L174-L181 |
26,633 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.getSequenceMapper | protected function getSequenceMapper() {
if (self::$sequenceMapper == null) {
self::$sequenceMapper = self::getMapper(self::SEQUENCE_CLASS);
}
return self::$sequenceMapper;
} | php | protected function getSequenceMapper() {
if (self::$sequenceMapper == null) {
self::$sequenceMapper = self::getMapper(self::SEQUENCE_CLASS);
}
return self::$sequenceMapper;
} | [
"protected",
"function",
"getSequenceMapper",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"sequenceMapper",
"==",
"null",
")",
"{",
"self",
"::",
"$",
"sequenceMapper",
"=",
"self",
"::",
"getMapper",
"(",
"self",
"::",
"SEQUENCE_CLASS",
")",
";",
"}",
... | Get the sequence mapper
@return PersistenceMapper | [
"Get",
"the",
"sequence",
"mapper"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L266-L271 |
26,634 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.getNextId | protected function getNextId() {
try {
$sequenceMapper = $this->getSequenceMapper();
$sequenceTable = $sequenceMapper->getRealTableName();
$sequenceConn = $sequenceMapper->getConnection();
$tableName = strtolower($this->getRealTableName());
// run id sequence in it's own transaction, ... | php | protected function getNextId() {
try {
$sequenceMapper = $this->getSequenceMapper();
$sequenceTable = $sequenceMapper->getRealTableName();
$sequenceConn = $sequenceMapper->getConnection();
$tableName = strtolower($this->getRealTableName());
// run id sequence in it's own transaction, ... | [
"protected",
"function",
"getNextId",
"(",
")",
"{",
"try",
"{",
"$",
"sequenceMapper",
"=",
"$",
"this",
"->",
"getSequenceMapper",
"(",
")",
";",
"$",
"sequenceTable",
"=",
"$",
"sequenceMapper",
"->",
"getRealTableName",
"(",
")",
";",
"$",
"sequenceConn"... | Get a new id for inserting into the database
@return An id value. | [
"Get",
"a",
"new",
"id",
"for",
"inserting",
"into",
"the",
"database"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L277-L324 |
26,635 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.executeSql | public function executeSql($sql, $parameters=[]) {
if ($this->adapter == null) {
$this->connect();
}
try {
$stmt = $this->adapter->createStatement($sql, $parameters);
$results = $stmt->execute();
if ($results->isQueryResult()) {
return $results->getResource()->fetchAll();
... | php | public function executeSql($sql, $parameters=[]) {
if ($this->adapter == null) {
$this->connect();
}
try {
$stmt = $this->adapter->createStatement($sql, $parameters);
$results = $stmt->execute();
if ($results->isQueryResult()) {
return $results->getResource()->fetchAll();
... | [
"public",
"function",
"executeSql",
"(",
"$",
"sql",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"adapter",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"try",
"{",
"$",
"stmt",
"=... | Execute a query on the connection.
@param $sql The SQL statement as string
@param $parameters An associative array of parameter name/values pairs to replace the placeholders with (optional, default: empty array)
@return If the query is a select, an array of associative arrays containing the selected data,
the number of... | [
"Execute",
"a",
"query",
"on",
"the",
"connection",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L370-L388 |
26,636 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.initRelations | private function initRelations() {
if ($this->relations == null) {
$this->relations = [];
$this->relations['all'] = array_values($this->getRelationDescriptions());
$this->relations['parent'] = [];
$this->relations['child'] = [];
$this->relations['undefined'] = [];
$this->relation... | php | private function initRelations() {
if ($this->relations == null) {
$this->relations = [];
$this->relations['all'] = array_values($this->getRelationDescriptions());
$this->relations['parent'] = [];
$this->relations['child'] = [];
$this->relations['undefined'] = [];
$this->relation... | [
"private",
"function",
"initRelations",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"relations",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"relations",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"relations",
"[",
"'all'",
"]",
"=",
"array_values",
"(",... | Get the relation descriptions defined in the subclass and add them to internal arrays. | [
"Get",
"the",
"relation",
"descriptions",
"defined",
"in",
"the",
"subclass",
"and",
"add",
"them",
"to",
"internal",
"arrays",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L512-L535 |
26,637 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.loadObjectsFromQueryParts | protected function loadObjectsFromQueryParts($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) {
if ($buildDepth < 0 && !in_array($buildDepth, [BuildDepth::INFINITE, BuildDepth::SINGLE])) {
throw new IllegalArgumentException("Build depth not supported: $buildDe... | php | protected function loadObjectsFromQueryParts($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null) {
if ($buildDepth < 0 && !in_array($buildDepth, [BuildDepth::INFINITE, BuildDepth::SINGLE])) {
throw new IllegalArgumentException("Build depth not supported: $buildDe... | [
"protected",
"function",
"loadObjectsFromQueryParts",
"(",
"$",
"type",
",",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
",",
"$",
"criteria",
"=",
"null",
",",
"$",
"orderby",
"=",
"null",
",",
"PagingInfo",
"$",
"pagingInfo",
"=",
"null",
")",
... | Load objects defined by several query parts.
@param $type The type of the object
@param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
(except BuildDepth::REQUIRED, BuildDepth::PROXIES_ONLY) (default: BuildDepth::SINGLE)
@param $criteria An array of Criteria instan... | [
"Load",
"objects",
"defined",
"by",
"several",
"query",
"parts",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L885-L895 |
26,638 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.createObjectFromData | protected function createObjectFromData(array $data) {
// determine if we are loading or creating
$createFromLoadedData = (sizeof($data) > 0) ? true : false;
// initialize data and oid
$oid = null;
$initialData = $data;
if ($createFromLoadedData) {
$oid = $this->constructOID($initialData)... | php | protected function createObjectFromData(array $data) {
// determine if we are loading or creating
$createFromLoadedData = (sizeof($data) > 0) ? true : false;
// initialize data and oid
$oid = null;
$initialData = $data;
if ($createFromLoadedData) {
$oid = $this->constructOID($initialData)... | [
"protected",
"function",
"createObjectFromData",
"(",
"array",
"$",
"data",
")",
"{",
"// determine if we are loading or creating",
"$",
"createFromLoadedData",
"=",
"(",
"sizeof",
"(",
"$",
"data",
")",
">",
"0",
")",
"?",
"true",
":",
"false",
";",
"// initial... | Create an object of the mapper's type with the given attributes from the given data
@param $data An associative array with the attribute names as keys and the attribute values as values
@return PersistentObject | [
"Create",
"an",
"object",
"of",
"the",
"mapper",
"s",
"type",
"with",
"the",
"given",
"attributes",
"from",
"the",
"given",
"data"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L950-L974 |
26,639 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.convertValueFromStorage | protected function convertValueFromStorage($valueName, $value) {
// filter values according to type
if ($this->hasAttribute($valueName)) {
$type = $this->getAttribute($valueName)->getType();
// integer
if (strpos(strtolower($type), 'int') === 0) {
$value = (strlen($value) == 0) ? null ... | php | protected function convertValueFromStorage($valueName, $value) {
// filter values according to type
if ($this->hasAttribute($valueName)) {
$type = $this->getAttribute($valueName)->getType();
// integer
if (strpos(strtolower($type), 'int') === 0) {
$value = (strlen($value) == 0) ? null ... | [
"protected",
"function",
"convertValueFromStorage",
"(",
"$",
"valueName",
",",
"$",
"value",
")",
"{",
"// filter values according to type",
"if",
"(",
"$",
"this",
"->",
"hasAttribute",
"(",
"$",
"valueName",
")",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"... | Convert value after retrieval from storage
@param $valueName
@param $value
@return Mixed | [
"Convert",
"value",
"after",
"retrieval",
"from",
"storage"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L982-L992 |
26,640 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.addRelatedObjects | protected function addRelatedObjects(array $objects, $buildDepth=BuildDepth::SINGLE) {
// recalculate build depth for the next generation
$newBuildDepth = $buildDepth;
if ($buildDepth != BuildDepth::SINGLE && $buildDepth != BuildDepth::INFINITE && $buildDepth > 0) {
$newBuildDepth = $buildDepth-1;
... | php | protected function addRelatedObjects(array $objects, $buildDepth=BuildDepth::SINGLE) {
// recalculate build depth for the next generation
$newBuildDepth = $buildDepth;
if ($buildDepth != BuildDepth::SINGLE && $buildDepth != BuildDepth::INFINITE && $buildDepth > 0) {
$newBuildDepth = $buildDepth-1;
... | [
"protected",
"function",
"addRelatedObjects",
"(",
"array",
"$",
"objects",
",",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
")",
"{",
"// recalculate build depth for the next generation",
"$",
"newBuildDepth",
"=",
"$",
"buildDepth",
";",
"if",
"(",
"$",
... | Append the child data to a list of object. If the buildDepth does not determine to load a
child generation, only the oids of the children will be loaded.
@param $objects Array of PersistentObject instances to append the children to
@param $buildDepth @see PersistenceFacade::loadObjects() | [
"Append",
"the",
"child",
"data",
"to",
"a",
"list",
"of",
"object",
".",
"If",
"the",
"buildDepth",
"does",
"not",
"determine",
"to",
"load",
"a",
"child",
"generation",
"only",
"the",
"oids",
"of",
"the",
"children",
"will",
"be",
"loaded",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L1000-L1037 |
26,641 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.handleDbEvent | public function handleDbEvent($e) {
$statement = $e->getParam('statement', null);
if ($statement != null) {
$this->statements[] = [$statement->getSql(), $statement->getParameterContainer()->getNamedArray()];
}
} | php | public function handleDbEvent($e) {
$statement = $e->getParam('statement', null);
if ($statement != null) {
$this->statements[] = [$statement->getSql(), $statement->getParameterContainer()->getNamedArray()];
}
} | [
"public",
"function",
"handleDbEvent",
"(",
"$",
"e",
")",
"{",
"$",
"statement",
"=",
"$",
"e",
"->",
"getParam",
"(",
"'statement'",
",",
"null",
")",
";",
"if",
"(",
"$",
"statement",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"statements",
"[",
... | Handle an event triggered from the zend db layer
@param $e | [
"Handle",
"an",
"event",
"triggered",
"from",
"the",
"zend",
"db",
"layer"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L1099-L1104 |
26,642 | iherwig/wcmf | src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php | AbstractRDBMapper.isInTransaction | protected function isInTransaction() {
return isset(self::$inTransaction[$this->connId]) && self::$inTransaction[$this->connId] === true;
} | php | protected function isInTransaction() {
return isset(self::$inTransaction[$this->connId]) && self::$inTransaction[$this->connId] === true;
} | [
"protected",
"function",
"isInTransaction",
"(",
")",
"{",
"return",
"isset",
"(",
"self",
"::",
"$",
"inTransaction",
"[",
"$",
"this",
"->",
"connId",
"]",
")",
"&&",
"self",
"::",
"$",
"inTransaction",
"[",
"$",
"this",
"->",
"connId",
"]",
"===",
"... | Check if the connection is currently in a transaction
@return Boolean | [
"Check",
"if",
"the",
"connection",
"is",
"currently",
"in",
"a",
"transaction"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/mapper/impl/AbstractRDBMapper.php#L1176-L1178 |
26,643 | vufind-org/vufindharvest | src/OaiPmh/HarvesterConsoleRunner.php | HarvesterConsoleRunner.getHelp | public function getHelp()
{
$msg = $this->opts->getUsageMessage();
// Amend the auto-generated help message:
$options = "[ options ] [ target ]\n"
. "Where [ target ] is the name of a section of the configuration\n"
. "specified by the ini option, or a directory to ha... | php | public function getHelp()
{
$msg = $this->opts->getUsageMessage();
// Amend the auto-generated help message:
$options = "[ options ] [ target ]\n"
. "Where [ target ] is the name of a section of the configuration\n"
. "specified by the ini option, or a directory to ha... | [
"public",
"function",
"getHelp",
"(",
")",
"{",
"$",
"msg",
"=",
"$",
"this",
"->",
"opts",
"->",
"getUsageMessage",
"(",
")",
";",
"// Amend the auto-generated help message:",
"$",
"options",
"=",
"\"[ options ] [ target ]\\n\"",
".",
"\"Where [ target ] is the name ... | Render help message.
@return void | [
"Render",
"help",
"message",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/HarvesterConsoleRunner.php#L194-L205 |
26,644 | vufind-org/vufindharvest | src/OaiPmh/HarvesterConsoleRunner.php | HarvesterConsoleRunner.run | public function run()
{
// Support help message:
if ($this->opts->getOption('h')) {
$this->getHelp();
return true;
}
if (!$allSettings = $this->getSettings()) {
return false;
}
// Loop through all the settings and perform harvests... | php | public function run()
{
// Support help message:
if ($this->opts->getOption('h')) {
$this->getHelp();
return true;
}
if (!$allSettings = $this->getSettings()) {
return false;
}
// Loop through all the settings and perform harvests... | [
"public",
"function",
"run",
"(",
")",
"{",
"// Support help message:",
"if",
"(",
"$",
"this",
"->",
"opts",
"->",
"getOption",
"(",
"'h'",
")",
")",
"{",
"$",
"this",
"->",
"getHelp",
"(",
")",
";",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"$"... | Run the task and return true on success.
@return bool | [
"Run",
"the",
"task",
"and",
"return",
"true",
"on",
"success",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/HarvesterConsoleRunner.php#L212-L254 |
26,645 | vufind-org/vufindharvest | src/OaiPmh/HarvesterConsoleRunner.php | HarvesterConsoleRunner.getSettings | protected function getSettings()
{
$ini = $this->opts->getOption('ini');
$argv = $this->opts->getRemainingArgs();
$section = $argv[0] ?? false;
if (!$ini && !$section) {
$this->writeLine(
'Please specify an .ini file with the --ini flag'
. ... | php | protected function getSettings()
{
$ini = $this->opts->getOption('ini');
$argv = $this->opts->getRemainingArgs();
$section = $argv[0] ?? false;
if (!$ini && !$section) {
$this->writeLine(
'Please specify an .ini file with the --ini flag'
. ... | [
"protected",
"function",
"getSettings",
"(",
")",
"{",
"$",
"ini",
"=",
"$",
"this",
"->",
"opts",
"->",
"getOption",
"(",
"'ini'",
")",
";",
"$",
"argv",
"=",
"$",
"this",
"->",
"opts",
"->",
"getRemainingArgs",
"(",
")",
";",
"$",
"section",
"=",
... | Load the harvest settings. Return false on error.
@return array|bool | [
"Load",
"the",
"harvest",
"settings",
".",
"Return",
"false",
"on",
"error",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/HarvesterConsoleRunner.php#L306-L321 |
26,646 | vufind-org/vufindharvest | src/OaiPmh/HarvesterConsoleRunner.php | HarvesterConsoleRunner.harvestSingleRepository | protected function harvestSingleRepository($target, $settings)
{
$settings['from'] = $this->opts->getOption('from');
$settings['until'] = $this->opts->getOption('until');
$settings['silent'] = false;
$harvest = $this->factory->getHarvester(
$target,
$this->get... | php | protected function harvestSingleRepository($target, $settings)
{
$settings['from'] = $this->opts->getOption('from');
$settings['until'] = $this->opts->getOption('until');
$settings['silent'] = false;
$harvest = $this->factory->getHarvester(
$target,
$this->get... | [
"protected",
"function",
"harvestSingleRepository",
"(",
"$",
"target",
",",
"$",
"settings",
")",
"{",
"$",
"settings",
"[",
"'from'",
"]",
"=",
"$",
"this",
"->",
"opts",
"->",
"getOption",
"(",
"'from'",
")",
";",
"$",
"settings",
"[",
"'until'",
"]",... | Harvest a single repository.
@param string $target Name of repo (used for target directory)
@param array $settings Settings for the harvester.
@return void
@throws \Exception | [
"Harvest",
"a",
"single",
"repository",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/HarvesterConsoleRunner.php#L332-L344 |
26,647 | iherwig/wcmf | src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php | DefaultLockHandler.storeLock | protected function storeLock(Lock $lock) {
if ($lock->getType() == Lock::TYPE_PESSIMISTIC) {
// pessimistic locks must be stored in the database in order
// to be seen by other users
$lockObj = $this->persistenceFacade->create($this->lockType, BuildDepth::REQUIRED);
$lockObj->setValue('objec... | php | protected function storeLock(Lock $lock) {
if ($lock->getType() == Lock::TYPE_PESSIMISTIC) {
// pessimistic locks must be stored in the database in order
// to be seen by other users
$lockObj = $this->persistenceFacade->create($this->lockType, BuildDepth::REQUIRED);
$lockObj->setValue('objec... | [
"protected",
"function",
"storeLock",
"(",
"Lock",
"$",
"lock",
")",
"{",
"if",
"(",
"$",
"lock",
"->",
"getType",
"(",
")",
"==",
"Lock",
"::",
"TYPE_PESSIMISTIC",
")",
"{",
"// pessimistic locks must be stored in the database in order",
"// to be seen by other users... | Store the given Lock instance for later retrieval
@param $lock Lock instance | [
"Store",
"the",
"given",
"Lock",
"instance",
"for",
"later",
"retrieval"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php#L209-L222 |
26,648 | iherwig/wcmf | src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php | DefaultLockHandler.getSessionLocks | protected function getSessionLocks() {
if ($this->session->exist(self::SESSION_VARNAME)) {
return $this->session->get(self::SESSION_VARNAME);
}
return [];
} | php | protected function getSessionLocks() {
if ($this->session->exist(self::SESSION_VARNAME)) {
return $this->session->get(self::SESSION_VARNAME);
}
return [];
} | [
"protected",
"function",
"getSessionLocks",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"session",
"->",
"exist",
"(",
"self",
"::",
"SESSION_VARNAME",
")",
")",
"{",
"return",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"self",
"::",
"SESSION_VARNA... | Get the Lock instances stored in the session
@return Associative array with the serialized ObjectId instances
as keys and the Lock instances as values | [
"Get",
"the",
"Lock",
"instances",
"stored",
"in",
"the",
"session"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php#L237-L242 |
26,649 | iherwig/wcmf | src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php | DefaultLockHandler.addSessionLock | protected function addSessionLock(Lock $lock) {
$locks = $this->getSessionLocks();
$locks[$lock->getObjectId()->__toString()] = $lock;
$this->session->set(self::SESSION_VARNAME, $locks);
} | php | protected function addSessionLock(Lock $lock) {
$locks = $this->getSessionLocks();
$locks[$lock->getObjectId()->__toString()] = $lock;
$this->session->set(self::SESSION_VARNAME, $locks);
} | [
"protected",
"function",
"addSessionLock",
"(",
"Lock",
"$",
"lock",
")",
"{",
"$",
"locks",
"=",
"$",
"this",
"->",
"getSessionLocks",
"(",
")",
";",
"$",
"locks",
"[",
"$",
"lock",
"->",
"getObjectId",
"(",
")",
"->",
"__toString",
"(",
")",
"]",
"... | Add a given Lock instance to the session
@param $lock Lock instance | [
"Add",
"a",
"given",
"Lock",
"instance",
"to",
"the",
"session"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php#L248-L252 |
26,650 | iherwig/wcmf | src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php | DefaultLockHandler.removeSessionLock | protected function removeSessionLock(ObjectId $oid, $type) {
$locks = $this->getSessionLocks();
if (isset($locks[$oid->__toString()])) {
$lock = $locks[$oid->__toString()];
if ($type == null || $type != null && $lock->getType() == $type) {
unset($locks[$oid->__toString()]);
$this->se... | php | protected function removeSessionLock(ObjectId $oid, $type) {
$locks = $this->getSessionLocks();
if (isset($locks[$oid->__toString()])) {
$lock = $locks[$oid->__toString()];
if ($type == null || $type != null && $lock->getType() == $type) {
unset($locks[$oid->__toString()]);
$this->se... | [
"protected",
"function",
"removeSessionLock",
"(",
"ObjectId",
"$",
"oid",
",",
"$",
"type",
")",
"{",
"$",
"locks",
"=",
"$",
"this",
"->",
"getSessionLocks",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"locks",
"[",
"$",
"oid",
"->",
"__toString",
... | Remove a given Lock instance from the session
@param $oid The locked oid
@param $type One of the Lock::Type constants or null for all types (default: _null_) | [
"Remove",
"a",
"given",
"Lock",
"instance",
"from",
"the",
"session"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/concurrency/impl/DefaultLockHandler.php#L259-L268 |
26,651 | iherwig/wcmf | src/wcmf/lib/presentation/format/impl/AbstractFormat.php | AbstractFormat.getNode | protected function getNode(ObjectId $oid) {
$oidStr = $oid->__toString();
if (!isset($this->deserializedNodes[$oidStr])) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$type = $oid->getType();
if ($persistenceFacade->isKnownType($type)) {
// don't create all va... | php | protected function getNode(ObjectId $oid) {
$oidStr = $oid->__toString();
if (!isset($this->deserializedNodes[$oidStr])) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$type = $oid->getType();
if ($persistenceFacade->isKnownType($type)) {
// don't create all va... | [
"protected",
"function",
"getNode",
"(",
"ObjectId",
"$",
"oid",
")",
"{",
"$",
"oidStr",
"=",
"$",
"oid",
"->",
"__toString",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"deserializedNodes",
"[",
"$",
"oidStr",
"]",
")",
")",
"... | Get a node with the given oid to deserialize values from form fields into it.
The method ensures that there is only one instance per oid.
@param $oid The oid
@return Node | [
"Get",
"a",
"node",
"with",
"the",
"given",
"oid",
"to",
"deserialize",
"values",
"from",
"form",
"fields",
"into",
"it",
".",
"The",
"method",
"ensures",
"that",
"there",
"is",
"only",
"one",
"instance",
"per",
"oid",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/format/impl/AbstractFormat.php#L121-L138 |
26,652 | iherwig/wcmf | src/wcmf/lib/core/impl/MonologFileLogger.php | MonologFileLogger.prepareMessage | private function prepareMessage($message) {
return is_string($message) ? $message :
(is_object($message) && method_exists($message, '__toString') ? $message->__toString() :
StringUtil::getDump($message));
} | php | private function prepareMessage($message) {
return is_string($message) ? $message :
(is_object($message) && method_exists($message, '__toString') ? $message->__toString() :
StringUtil::getDump($message));
} | [
"private",
"function",
"prepareMessage",
"(",
"$",
"message",
")",
"{",
"return",
"is_string",
"(",
"$",
"message",
")",
"?",
"$",
"message",
":",
"(",
"is_object",
"(",
"$",
"message",
")",
"&&",
"method_exists",
"(",
"$",
"message",
",",
"'__toString'",
... | Prepare a message to be used with the internal logger
@param $message
@return String | [
"Prepare",
"a",
"message",
"to",
"be",
"used",
"with",
"the",
"internal",
"logger"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/impl/MonologFileLogger.php#L191-L195 |
26,653 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.filter | public static function filter(array $nodeList, ObjectId $oid=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
$returnArray = [];
for ($i=0, $count=sizeof($nodeList); $i<$count; $i++) {
$curNode = $nodeList[$i];
if ($curNode instanceof PersistentObject) {
$match... | php | public static function filter(array $nodeList, ObjectId $oid=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
$returnArray = [];
for ($i=0, $count=sizeof($nodeList); $i<$count; $i++) {
$curNode = $nodeList[$i];
if ($curNode instanceof PersistentObject) {
$match... | [
"public",
"static",
"function",
"filter",
"(",
"array",
"$",
"nodeList",
",",
"ObjectId",
"$",
"oid",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"values",
"=",
"null",
",",
"$",
"properties",
"=",
"null",
",",
"$",
"useRegExp",
"=",
"true"... | Get Nodes that match given conditions from a list.
@param $nodeList An array of nodes to filter or a single Node.
@param $oid The object id that the Nodes should match (optional, default: _null_)
@param $type The type that the Nodes should match (either fully qualified or simple, if not ambiguous)
(optional, default: _... | [
"Get",
"Nodes",
"that",
"match",
"given",
"conditions",
"from",
"a",
"list",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L185-L237 |
26,654 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getRelationNames | public function getRelationNames() {
$result = [];
$relations = $this->getRelations();
foreach ($relations as $curRelation) {
$result[] = $curRelation->getOtherRole();
}
return $result;
} | php | public function getRelationNames() {
$result = [];
$relations = $this->getRelations();
foreach ($relations as $curRelation) {
$result[] = $curRelation->getOtherRole();
}
return $result;
} | [
"public",
"function",
"getRelationNames",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"relations",
"=",
"$",
"this",
"->",
"getRelations",
"(",
")",
";",
"foreach",
"(",
"$",
"relations",
"as",
"$",
"curRelation",
")",
"{",
"$",
"result",
... | Get the names of all relations.
@return An array of relation names. | [
"Get",
"the",
"names",
"of",
"all",
"relations",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L305-L312 |
26,655 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.addNode | public function addNode(PersistentObject $other, $role=null, $forceSet=false, $trackChange=true, $updateOtherSide=true) {
$mapper = $this->getMapper();
// set role if missing
if ($role == null) {
$otherType = $other->getType();
$relations = $mapper->getRelationsByType($otherType);
$role =... | php | public function addNode(PersistentObject $other, $role=null, $forceSet=false, $trackChange=true, $updateOtherSide=true) {
$mapper = $this->getMapper();
// set role if missing
if ($role == null) {
$otherType = $other->getType();
$relations = $mapper->getRelationsByType($otherType);
$role =... | [
"public",
"function",
"addNode",
"(",
"PersistentObject",
"$",
"other",
",",
"$",
"role",
"=",
"null",
",",
"$",
"forceSet",
"=",
"false",
",",
"$",
"trackChange",
"=",
"true",
",",
"$",
"updateOtherSide",
"=",
"true",
")",
"{",
"$",
"mapper",
"=",
"$"... | Add a Node to the given relation. Delegates to setValue internally.
@param $other PersistentObject
@param $role The role of the Node in the created relation. If null, the role will be
the Node's simple type (without namespace) (default: _null_)
@param $forceSet @see PersistentObject::setValue()
@param $trackChange @see... | [
"Add",
"a",
"Node",
"to",
"the",
"given",
"relation",
".",
"Delegates",
"to",
"setValue",
"internally",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L324-L373 |
26,656 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.deleteNode | public function deleteNode(PersistentObject $other, $role=null, $updateOtherSide=true) {
$mapper = $this->getMapper();
// set role if missing
if ($role == null) {
$otherType = $other->getType();
$relations = $mapper->getRelationsByType($otherType);
$role = (sizeof($relations) > 0) ? $rel... | php | public function deleteNode(PersistentObject $other, $role=null, $updateOtherSide=true) {
$mapper = $this->getMapper();
// set role if missing
if ($role == null) {
$otherType = $other->getType();
$relations = $mapper->getRelationsByType($otherType);
$role = (sizeof($relations) > 0) ? $rel... | [
"public",
"function",
"deleteNode",
"(",
"PersistentObject",
"$",
"other",
",",
"$",
"role",
"=",
"null",
",",
"$",
"updateOtherSide",
"=",
"true",
")",
"{",
"$",
"mapper",
"=",
"$",
"this",
"->",
"getMapper",
"(",
")",
";",
"// set role if missing",
"if",... | Delete a Node from the given relation.
@param $other The Node to delete.
@param $role The role of the Node. If null, the role is the Node's type (without namespace) (default: _null_)
@param $updateOtherSide Boolean whether to update also the other side of the relation (default: _true_) | [
"Delete",
"a",
"Node",
"from",
"the",
"given",
"relation",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L391-L443 |
26,657 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.setNodeOrder | public function setNodeOrder(array $orderedList, array $movedList=null, $role=null) {
$this->orderedNodes = [
'ordered' => $orderedList,
'moved' => $movedList,
'role' => $role
];
$this->setState(PersistentOBject::STATE_DIRTY);
} | php | public function setNodeOrder(array $orderedList, array $movedList=null, $role=null) {
$this->orderedNodes = [
'ordered' => $orderedList,
'moved' => $movedList,
'role' => $role
];
$this->setState(PersistentOBject::STATE_DIRTY);
} | [
"public",
"function",
"setNodeOrder",
"(",
"array",
"$",
"orderedList",
",",
"array",
"$",
"movedList",
"=",
"null",
",",
"$",
"role",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"orderedNodes",
"=",
"[",
"'ordered'",
"=>",
"$",
"orderedList",
",",
"'moved... | Define the order of related Node instances. The mapper is responsible for
persisting the order of the given Node instances in relation to this Node.
@note Note instances, that are not explicitly sortable by a sortkey
(@see PersistenceMapper::getDefaultOrder()) will be ignored. If a given
Node instance is not related to... | [
"Define",
"the",
"order",
"of",
"related",
"Node",
"instances",
".",
"The",
"mapper",
"is",
"responsible",
"for",
"persisting",
"the",
"order",
"of",
"the",
"given",
"Node",
"instances",
"in",
"relation",
"to",
"this",
"Node",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L466-L473 |
26,658 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.loadChildren | public function loadChildren($role=null, $buildDepth=BuildDepth::SINGLE) {
if ($role != null) {
$this->loadRelations([$role], $buildDepth);
}
else {
$this->loadRelations(array_keys($this->getPossibleChildren()), $buildDepth);
}
} | php | public function loadChildren($role=null, $buildDepth=BuildDepth::SINGLE) {
if ($role != null) {
$this->loadRelations([$role], $buildDepth);
}
else {
$this->loadRelations(array_keys($this->getPossibleChildren()), $buildDepth);
}
} | [
"public",
"function",
"loadChildren",
"(",
"$",
"role",
"=",
"null",
",",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
")",
"{",
"if",
"(",
"$",
"role",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"loadRelations",
"(",
"[",
"$",
"role",
"]",
... | Load the children of a given role and add them. If all children should be
loaded, set the role parameter to null.
@param $role The role of children to load (maybe null, to load all children) (default: _null_)
@param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
(d... | [
"Load",
"the",
"children",
"of",
"a",
"given",
"role",
"and",
"add",
"them",
".",
"If",
"all",
"children",
"should",
"be",
"loaded",
"set",
"the",
"role",
"parameter",
"to",
"null",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L491-L498 |
26,659 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getFirstChild | public function getFirstChild($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
$children = $this->getChildrenEx(null, $role, $type, $values, $properties, $useRegExp);
if (sizeof($children) > 0) {
return $children[0];
}
else {
return null;
}
} | php | public function getFirstChild($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
$children = $this->getChildrenEx(null, $role, $type, $values, $properties, $useRegExp);
if (sizeof($children) > 0) {
return $children[0];
}
else {
return null;
}
} | [
"public",
"function",
"getFirstChild",
"(",
"$",
"role",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"values",
"=",
"null",
",",
"$",
"properties",
"=",
"null",
",",
"$",
"useRegExp",
"=",
"true",
")",
"{",
"$",
"children",
"=",
"$",
"thi... | Get the first child that matches given conditions.
@param $role The role that the child should match (optional, default: _null_).
@param $type The type that the child should match (either fully qualified or simple, if not ambiguous)
(optional, default: _null_).
@param $values An associative array holding key value pair... | [
"Get",
"the",
"first",
"child",
"that",
"matches",
"given",
"conditions",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L519-L527 |
26,660 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getChildrenEx | public function getChildrenEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
if ($role != null) {
// nodes of a given role are requested
// make sure it is a child role
$childRoles = $this->getPossibleChildren();
if (!isset($childRole... | php | public function getChildrenEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
if ($role != null) {
// nodes of a given role are requested
// make sure it is a child role
$childRoles = $this->getPossibleChildren();
if (!isset($childRole... | [
"public",
"function",
"getChildrenEx",
"(",
"ObjectId",
"$",
"oid",
"=",
"null",
",",
"$",
"role",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"values",
"=",
"null",
",",
"$",
"properties",
"=",
"null",
",",
"$",
"useRegExp",
"=",
"true",
... | Get the children that match given conditions.
@note This method will only return objects that are already loaded, to get all objects in
the given relation (including proxies), use the Node::getValue() method and filter the returned
list afterwards.
@param $oid The object id that the children should match (optional, def... | [
"Get",
"the",
"children",
"that",
"match",
"given",
"conditions",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L552-L578 |
26,661 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.loadParents | public function loadParents($role=null, $buildDepth=BuildDepth::SINGLE) {
if ($role != null) {
$this->loadRelations([$role], $buildDepth);
}
else {
$this->loadRelations(array_keys($this->getPossibleParents()), $buildDepth);
}
} | php | public function loadParents($role=null, $buildDepth=BuildDepth::SINGLE) {
if ($role != null) {
$this->loadRelations([$role], $buildDepth);
}
else {
$this->loadRelations(array_keys($this->getPossibleParents()), $buildDepth);
}
} | [
"public",
"function",
"loadParents",
"(",
"$",
"role",
"=",
"null",
",",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
")",
"{",
"if",
"(",
"$",
"role",
"!=",
"null",
")",
"{",
"$",
"this",
"->",
"loadRelations",
"(",
"[",
"$",
"role",
"]",
... | Load the parents of a given role and add them. If all parents should be
loaded, set the role parameter to null.
@param $role The role of parents to load (maybe null, to load all parents) (default: _null_)
@param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
(defau... | [
"Load",
"the",
"parents",
"of",
"a",
"given",
"role",
"and",
"add",
"them",
".",
"If",
"all",
"parents",
"should",
"be",
"loaded",
"set",
"the",
"role",
"parameter",
"to",
"null",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L600-L607 |
26,662 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getFirstParent | public function getFirstParent($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
$parents = $this->getParentsEx(null, $role, $type, $values, $properties, $useRegExp);
if (sizeof($parents) > 0) {
return $parents[0];
}
else {
return null;
}
} | php | public function getFirstParent($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
$parents = $this->getParentsEx(null, $role, $type, $values, $properties, $useRegExp);
if (sizeof($parents) > 0) {
return $parents[0];
}
else {
return null;
}
} | [
"public",
"function",
"getFirstParent",
"(",
"$",
"role",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"values",
"=",
"null",
",",
"$",
"properties",
"=",
"null",
",",
"$",
"useRegExp",
"=",
"true",
")",
"{",
"$",
"parents",
"=",
"$",
"thi... | Get the first parent that matches given conditions.
@param $role The role that the parent should match (optional, default: _null_).
@param $type The type that the parent should match (either fully qualified or simple, if not ambiguous)
(optional, default: _null_).
@param $values An associative array holding key value p... | [
"Get",
"the",
"first",
"parent",
"that",
"matches",
"given",
"conditions",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L643-L652 |
26,663 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getParentsEx | public function getParentsEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
if ($role != null) {
// nodes of a given role are requested
// make sure it is a parent role
$parentRoles = $this->getPossibleParents();
if (!isset($parentRol... | php | public function getParentsEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
$properties=null, $useRegExp=true) {
if ($role != null) {
// nodes of a given role are requested
// make sure it is a parent role
$parentRoles = $this->getPossibleParents();
if (!isset($parentRol... | [
"public",
"function",
"getParentsEx",
"(",
"ObjectId",
"$",
"oid",
"=",
"null",
",",
"$",
"role",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"values",
"=",
"null",
",",
"$",
"properties",
"=",
"null",
",",
"$",
"useRegExp",
"=",
"true",
... | Get the parents that match given conditions.
@note This method will only return objects that are already loaded, to get all objects in
the given relation (including proxies), use the Node::getValue() method and filter the returned
list afterwards.
@param $oid The object id that the parent should match (optional, defaul... | [
"Get",
"the",
"parents",
"that",
"match",
"given",
"conditions",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L677-L703 |
26,664 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getNodeRelation | public function getNodeRelation($object) {
$relations = $this->getRelations();
foreach ($relations as $curRelation) {
$curRelatives = parent::getValue($curRelation->getOtherRole());
if ($curRelatives instanceof Node && $curRelatives->getOID() == $object->getOID()) {
return $curRelation;
... | php | public function getNodeRelation($object) {
$relations = $this->getRelations();
foreach ($relations as $curRelation) {
$curRelatives = parent::getValue($curRelation->getOtherRole());
if ($curRelatives instanceof Node && $curRelatives->getOID() == $object->getOID()) {
return $curRelation;
... | [
"public",
"function",
"getNodeRelation",
"(",
"$",
"object",
")",
"{",
"$",
"relations",
"=",
"$",
"this",
"->",
"getRelations",
"(",
")",
";",
"foreach",
"(",
"$",
"relations",
"as",
"$",
"curRelation",
")",
"{",
"$",
"curRelatives",
"=",
"parent",
"::"... | Get the relation description for a given node.
@param $object PersistentObject instance to look for
@return RelationDescription instance or null, if the Node is not related | [
"Get",
"the",
"relation",
"description",
"for",
"a",
"given",
"node",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L723-L739 |
26,665 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.loadRelations | protected function loadRelations(array $roles, $buildDepth=BuildDepth::SINGLE) {
$oldState = $this->getState();
foreach ($roles as $curRole) {
if (isset($this->relationStates[$curRole]) &&
$this->relationStates[$curRole] != self::RELATION_STATE_LOADED) {
$relatives = [];
// ... | php | protected function loadRelations(array $roles, $buildDepth=BuildDepth::SINGLE) {
$oldState = $this->getState();
foreach ($roles as $curRole) {
if (isset($this->relationStates[$curRole]) &&
$this->relationStates[$curRole] != self::RELATION_STATE_LOADED) {
$relatives = [];
// ... | [
"protected",
"function",
"loadRelations",
"(",
"array",
"$",
"roles",
",",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
")",
"{",
"$",
"oldState",
"=",
"$",
"this",
"->",
"getState",
"(",
")",
";",
"foreach",
"(",
"$",
"roles",
"as",
"$",
"cur... | Load all objects in the given set of relations
@param $roles An array of relation (=role) names
@param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
(default: _BuildDepth::SINGLE_) | [
"Load",
"all",
"objects",
"in",
"the",
"given",
"set",
"of",
"relations"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L747-L786 |
26,666 | iherwig/wcmf | src/wcmf/lib/model/Node.php | Node.getRelatives | public function getRelatives($hierarchyType, $memOnly=true) {
$relatives = [];
$relations = $this->getRelations($hierarchyType);
foreach ($relations as $curRelation) {
$curRelatives = null;
if ($memOnly) {
$curRelatives = parent::getValue($curRelation->getOtherRole());
}
else... | php | public function getRelatives($hierarchyType, $memOnly=true) {
$relatives = [];
$relations = $this->getRelations($hierarchyType);
foreach ($relations as $curRelation) {
$curRelatives = null;
if ($memOnly) {
$curRelatives = parent::getValue($curRelation->getOtherRole());
}
else... | [
"public",
"function",
"getRelatives",
"(",
"$",
"hierarchyType",
",",
"$",
"memOnly",
"=",
"true",
")",
"{",
"$",
"relatives",
"=",
"[",
"]",
";",
"$",
"relations",
"=",
"$",
"this",
"->",
"getRelations",
"(",
"$",
"hierarchyType",
")",
";",
"foreach",
... | Get the relatives of a given hierarchyType.
@param $hierarchyType @see PersistenceMapper::getRelations
@param $memOnly Boolean whether to only get the relatives in memory or all relatives (including proxies) (default: _true_).
@return An array containing the relatives. | [
"Get",
"the",
"relatives",
"of",
"a",
"given",
"hierarchyType",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/Node.php#L803-L831 |
26,667 | iherwig/wcmf | src/wcmf/lib/core/impl/ClientSideSession.php | ClientSideSession.createToken | protected function createToken($login) {
$jwt = (new Builder())
->setIssuer($this->getTokenIssuer())
->setIssuedAt(time())
->setExpiration(time()+3600)
->set(self::AUTH_USER_NAME, $login)
->sign($this->getTokenSigner(), $this->key)
->getToken()... | php | protected function createToken($login) {
$jwt = (new Builder())
->setIssuer($this->getTokenIssuer())
->setIssuedAt(time())
->setExpiration(time()+3600)
->set(self::AUTH_USER_NAME, $login)
->sign($this->getTokenSigner(), $this->key)
->getToken()... | [
"protected",
"function",
"createToken",
"(",
"$",
"login",
")",
"{",
"$",
"jwt",
"=",
"(",
"new",
"Builder",
"(",
")",
")",
"->",
"setIssuer",
"(",
"$",
"this",
"->",
"getTokenIssuer",
"(",
")",
")",
"->",
"setIssuedAt",
"(",
"time",
"(",
")",
")",
... | Create the token for the given login
@param $login
@return String | [
"Create",
"the",
"token",
"for",
"the",
"given",
"login"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/impl/ClientSideSession.php#L177-L186 |
26,668 | iherwig/wcmf | src/wcmf/lib/core/impl/ClientSideSession.php | ClientSideSession.getTokenData | protected function getTokenData() {
$result = null;
$request = ObjectFactory::getInstance('request');
$token = $request->hasHeader(self::TOKEN_HEADER) ?
trim(str_replace(self::AUTH_TYPE, '', $request->getHeader(self::TOKEN_HEADER))) : $this->token;
if ($token !== null) {
$jwt = (new Parse... | php | protected function getTokenData() {
$result = null;
$request = ObjectFactory::getInstance('request');
$token = $request->hasHeader(self::TOKEN_HEADER) ?
trim(str_replace(self::AUTH_TYPE, '', $request->getHeader(self::TOKEN_HEADER))) : $this->token;
if ($token !== null) {
$jwt = (new Parse... | [
"protected",
"function",
"getTokenData",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"request",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'request'",
")",
";",
"$",
"token",
"=",
"$",
"request",
"->",
"hasHeader",
"(",
"self",
"::",
"TOKE... | Get the claims stored in the JWT
@return Associative array | [
"Get",
"the",
"claims",
"stored",
"in",
"the",
"JWT"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/impl/ClientSideSession.php#L208-L225 |
26,669 | iherwig/wcmf | src/wcmf/lib/service/SoapServer.php | SoapServer.getResponseHeaders | public function getResponseHeaders() {
$headerStrings = headers_list();
header_remove();
$headers = [];
foreach ($headerStrings as $header) {
list($name, $value) = explode(':', $header, 2);
$headers[trim($name)] = trim($value);
}
return $headers;
} | php | public function getResponseHeaders() {
$headerStrings = headers_list();
header_remove();
$headers = [];
foreach ($headerStrings as $header) {
list($name, $value) = explode(':', $header, 2);
$headers[trim($name)] = trim($value);
}
return $headers;
} | [
"public",
"function",
"getResponseHeaders",
"(",
")",
"{",
"$",
"headerStrings",
"=",
"headers_list",
"(",
")",
";",
"header_remove",
"(",
")",
";",
"$",
"headers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headerStrings",
"as",
"$",
"header",
")",
"{",
... | Get the response headers after a call to the service method
@return Array | [
"Get",
"the",
"response",
"headers",
"after",
"a",
"call",
"to",
"the",
"service",
"method"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapServer.php#L120-L129 |
26,670 | iherwig/wcmf | src/wcmf/lib/service/SoapServer.php | SoapServer.doCall | public function doCall($action, $params) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("SoapServer action: ".$action);
self::$logger->debug($params);
}
$authHeader = $this->requestHeader['Security']['UsernameToken'];
$request = ObjectFactory::getInstance('request');
$req... | php | public function doCall($action, $params) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("SoapServer action: ".$action);
self::$logger->debug($params);
}
$authHeader = $this->requestHeader['Security']['UsernameToken'];
$request = ObjectFactory::getInstance('request');
$req... | [
"public",
"function",
"doCall",
"(",
"$",
"action",
",",
"$",
"params",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
"->",
"isDebugEnabled",
"(",
")",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"debug",
"(",
"\"SoapServer action: \"",
".",
"$",
... | Process a soap call
@param $action The action
@param $params The action parameters
@return The Response instance from the executed Controller | [
"Process",
"a",
"soap",
"call"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/service/SoapServer.php#L154-L211 |
26,671 | iherwig/wcmf | src/wcmf/application/controller/SearchIndexController.php | SearchIndexController.collect | protected function collect($types) {
$persistenceFacade = $this->getPersistenceFacade();
$nodesPerCall = $this->getRequestValue('nodesPerCall');
foreach ($types as $type) {
$oids = $persistenceFacade->getOIDs($type);
$oidLists = array_chunk($oids, self::OPTIMIZE_FREQ);
for ($i=0, $count=si... | php | protected function collect($types) {
$persistenceFacade = $this->getPersistenceFacade();
$nodesPerCall = $this->getRequestValue('nodesPerCall');
foreach ($types as $type) {
$oids = $persistenceFacade->getOIDs($type);
$oidLists = array_chunk($oids, self::OPTIMIZE_FREQ);
for ($i=0, $count=si... | [
"protected",
"function",
"collect",
"(",
"$",
"types",
")",
"{",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"$",
"nodesPerCall",
"=",
"$",
"this",
"->",
"getRequestValue",
"(",
"'nodesPerCall'",
")",
";",
"foreac... | Collect all oids of the given types
@param $types The types to process
@note This is a callback method called on a matching work package @see BatchController::addWorkPackage() | [
"Collect",
"all",
"oids",
"of",
"the",
"given",
"types"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SearchIndexController.php#L129-L142 |
26,672 | iherwig/wcmf | src/wcmf/application/controller/SearchIndexController.php | SearchIndexController.index | protected function index($oids) {
$persistenceFacade = $this->getPersistenceFacade();
foreach($oids as $oid) {
if (ObjectId::isValid($oid)) {
$obj = $persistenceFacade->load($oid);
if ($obj) {
$this->search->addToIndex($obj);
}
}
}
$this->search->commitIndex... | php | protected function index($oids) {
$persistenceFacade = $this->getPersistenceFacade();
foreach($oids as $oid) {
if (ObjectId::isValid($oid)) {
$obj = $persistenceFacade->load($oid);
if ($obj) {
$this->search->addToIndex($obj);
}
}
}
$this->search->commitIndex... | [
"protected",
"function",
"index",
"(",
"$",
"oids",
")",
"{",
"$",
"persistenceFacade",
"=",
"$",
"this",
"->",
"getPersistenceFacade",
"(",
")",
";",
"foreach",
"(",
"$",
"oids",
"as",
"$",
"oid",
")",
"{",
"if",
"(",
"ObjectId",
"::",
"isValid",
"(",... | Create the lucene index from the given objects
@param $oids The oids to process
@note This is a callback method called on a matching work package @see BatchController::addWorkPackage() | [
"Create",
"the",
"lucene",
"index",
"from",
"the",
"given",
"objects"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/SearchIndexController.php#L149-L165 |
26,673 | iherwig/wcmf | src/wcmf/lib/core/ErrorHandler.php | ErrorHandler.getStackTrace | public static function getStackTrace() {
ob_start();
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$trace = ob_get_contents();
ob_end_clean();
// remove first item from backtrace as it's this function which is redundant.
$trace = preg_replace('/^#0\s+'.__FUNCTION__."[^\n]*\n/", '', $trace... | php | public static function getStackTrace() {
ob_start();
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$trace = ob_get_contents();
ob_end_clean();
// remove first item from backtrace as it's this function which is redundant.
$trace = preg_replace('/^#0\s+'.__FUNCTION__."[^\n]*\n/", '', $trace... | [
"public",
"static",
"function",
"getStackTrace",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"debug_print_backtrace",
"(",
"DEBUG_BACKTRACE_IGNORE_ARGS",
")",
";",
"$",
"trace",
"=",
"ob_get_contents",
"(",
")",
";",
"ob_end_clean",
"(",
")",
";",
"// remove first... | Get the stack trace
@return The stack trace as string | [
"Get",
"the",
"stack",
"trace"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/ErrorHandler.php#L45-L55 |
26,674 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.getConnections | public static function getConnections($type, $otherRole, $otherType, $hierarchyType='all') {
$paths = [];
self::getConnectionsImpl($type, $otherRole, $otherType, $hierarchyType, $paths);
$minLength = -1;
$shortestPaths = [];
foreach ($paths as $curPath) {
$curLength = $curPath->getPathLength()... | php | public static function getConnections($type, $otherRole, $otherType, $hierarchyType='all') {
$paths = [];
self::getConnectionsImpl($type, $otherRole, $otherType, $hierarchyType, $paths);
$minLength = -1;
$shortestPaths = [];
foreach ($paths as $curPath) {
$curLength = $curPath->getPathLength()... | [
"public",
"static",
"function",
"getConnections",
"(",
"$",
"type",
",",
"$",
"otherRole",
",",
"$",
"otherType",
",",
"$",
"hierarchyType",
"=",
"'all'",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"self",
"::",
"getConnectionsImpl",
"(",
"$",
"type",
... | Get the shortest paths that connect a type to another type.
@param $type The type to start from
@param $otherRole The role of the type at the other end (maybe null, if only type shoudl match)
@param $otherType The type at the other end (maybe null, if only role shoudl match)
@param $hierarchyType The hierarchy type tha... | [
"Get",
"the",
"shortest",
"paths",
"that",
"connect",
"a",
"type",
"to",
"another",
"type",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L39-L55 |
26,675 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.getConnectionsImpl | protected static function getConnectionsImpl($type, $otherRole, $otherType,
$hierarchyType, array &$result=[], array $currentPath=[]) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$mapper = $persistenceFacade->getMapper($type);
// check relations
$relationDescs = $ma... | php | protected static function getConnectionsImpl($type, $otherRole, $otherType,
$hierarchyType, array &$result=[], array $currentPath=[]) {
$persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
$mapper = $persistenceFacade->getMapper($type);
// check relations
$relationDescs = $ma... | [
"protected",
"static",
"function",
"getConnectionsImpl",
"(",
"$",
"type",
",",
"$",
"otherRole",
",",
"$",
"otherType",
",",
"$",
"hierarchyType",
",",
"array",
"&",
"$",
"result",
"=",
"[",
"]",
",",
"array",
"$",
"currentPath",
"=",
"[",
"]",
")",
"... | Get the relations that connect a type to another type.
@param $type The type to start from
@param $otherRole The role of the type at the other end (maybe null, if only type shoudl match)
@param $otherType The type at the other end (maybe null, if only role shoudl match)
@param $hierarchyType The hierarchy type that the... | [
"Get",
"the",
"relations",
"that",
"connect",
"a",
"type",
"to",
"another",
"type",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L67-L109 |
26,676 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.getRelationQueryCondition | public static function getRelationQueryCondition($node, $otherRole) {
$mapper = $node->getMapper();
$relationDescription = $mapper->getRelation($otherRole);
$otherType = $relationDescription->getOtherType();
$query = new ObjectQuery($otherType, __CLASS__.__METHOD__.$node->getType().$otherRole);
// ... | php | public static function getRelationQueryCondition($node, $otherRole) {
$mapper = $node->getMapper();
$relationDescription = $mapper->getRelation($otherRole);
$otherType = $relationDescription->getOtherType();
$query = new ObjectQuery($otherType, __CLASS__.__METHOD__.$node->getType().$otherRole);
// ... | [
"public",
"static",
"function",
"getRelationQueryCondition",
"(",
"$",
"node",
",",
"$",
"otherRole",
")",
"{",
"$",
"mapper",
"=",
"$",
"node",
"->",
"getMapper",
"(",
")",
";",
"$",
"relationDescription",
"=",
"$",
"mapper",
"->",
"getRelation",
"(",
"$"... | Get the query condition used to select all related Nodes of a given role.
@param $node The Node to select the relatives for
@param $otherRole The role of the other nodes
@return The condition string to be used with StringQuery. | [
"Get",
"the",
"query",
"condition",
"used",
"to",
"select",
"all",
"related",
"Nodes",
"of",
"a",
"given",
"role",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L117-L141 |
26,677 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.makeNodeUrlsRelative | public static function makeNodeUrlsRelative(Node $node, $baseUrl, $recursive=true) {
// use NodeValueIterator to iterate over all Node values
// and call the global convert function on each
$iter = new NodeValueIterator($node, $recursive);
for($iter->rewind(); $iter->valid(); $iter->next()) {
self... | php | public static function makeNodeUrlsRelative(Node $node, $baseUrl, $recursive=true) {
// use NodeValueIterator to iterate over all Node values
// and call the global convert function on each
$iter = new NodeValueIterator($node, $recursive);
for($iter->rewind(); $iter->valid(); $iter->next()) {
self... | [
"public",
"static",
"function",
"makeNodeUrlsRelative",
"(",
"Node",
"$",
"node",
",",
"$",
"baseUrl",
",",
"$",
"recursive",
"=",
"true",
")",
"{",
"// use NodeValueIterator to iterate over all Node values",
"// and call the global convert function on each",
"$",
"iter",
... | Make all urls matching a given base url in a Node relative.
@param $node Node instance that holds the value
@param $baseUrl The baseUrl to which matching urls will be made relative
@param $recursive Boolean whether to recurse into child Nodes or not (default: true) | [
"Make",
"all",
"urls",
"matching",
"a",
"given",
"base",
"url",
"in",
"a",
"Node",
"relative",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L202-L209 |
26,678 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.makeValueUrlsRelative | private static function makeValueUrlsRelative(PersistentObject $object, $valueName, $baseUrl) {
$value = $object->getValue($valueName);
// find urls in texts
$urls = StringUtil::getUrls($value);
// find direct attribute urls
if (strpos($value, 'http://') === 0 || strpos($value, 'https://') === 0) {... | php | private static function makeValueUrlsRelative(PersistentObject $object, $valueName, $baseUrl) {
$value = $object->getValue($valueName);
// find urls in texts
$urls = StringUtil::getUrls($value);
// find direct attribute urls
if (strpos($value, 'http://') === 0 || strpos($value, 'https://') === 0) {... | [
"private",
"static",
"function",
"makeValueUrlsRelative",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"valueName",
",",
"$",
"baseUrl",
")",
"{",
"$",
"value",
"=",
"$",
"object",
"->",
"getValue",
"(",
"$",
"valueName",
")",
";",
"// find urls in texts"... | Make the urls matching a given base url in a PersistentObject value relative.
@param $node Node instance that holds the value
@param $valueName The name of the value
@param $baseUrl The baseUrl to which matching urls will be made relative | [
"Make",
"the",
"urls",
"matching",
"a",
"given",
"base",
"url",
"in",
"a",
"PersistentObject",
"value",
"relative",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L217-L237 |
26,679 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.translateValues | public static function translateValues(&$nodes, $language=null, $itemDelim=", ") {
// translate the node values
for($i=0; $i<sizeof($nodes); $i++) {
$iter = new NodeValueIterator($nodes[$i], false);
for($iter->rewind(); $iter->valid(); $iter->next()) {
self::translateValue($iter->currentNode... | php | public static function translateValues(&$nodes, $language=null, $itemDelim=", ") {
// translate the node values
for($i=0; $i<sizeof($nodes); $i++) {
$iter = new NodeValueIterator($nodes[$i], false);
for($iter->rewind(); $iter->valid(); $iter->next()) {
self::translateValue($iter->currentNode... | [
"public",
"static",
"function",
"translateValues",
"(",
"&",
"$",
"nodes",
",",
"$",
"language",
"=",
"null",
",",
"$",
"itemDelim",
"=",
"\", \"",
")",
"{",
"// translate the node values",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"sizeof",
... | Translate all list values in a list of Nodes.
@note Translation in this case refers to mapping list values from the key to the value
and should not be confused with localization, although values maybe localized using the
language parameter.
@param $nodes A reference to the array of Node instances
@param $language The l... | [
"Translate",
"all",
"list",
"values",
"in",
"a",
"list",
"of",
"Nodes",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L249-L257 |
26,680 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.translateValue | public static function translateValue(PersistentObject $object, $valueName, $language, $itemDelim=", ") {
$value = $object->getValue($valueName);
// translate list values
$value = ValueListProvider::translateValue($value, $object->getValueProperty($valueName, 'input_type'), $language, $itemDelim);
// fo... | php | public static function translateValue(PersistentObject $object, $valueName, $language, $itemDelim=", ") {
$value = $object->getValue($valueName);
// translate list values
$value = ValueListProvider::translateValue($value, $object->getValueProperty($valueName, 'input_type'), $language, $itemDelim);
// fo... | [
"public",
"static",
"function",
"translateValue",
"(",
"PersistentObject",
"$",
"object",
",",
"$",
"valueName",
",",
"$",
"language",
",",
"$",
"itemDelim",
"=",
"\", \"",
")",
"{",
"$",
"value",
"=",
"$",
"object",
"->",
"getValue",
"(",
"$",
"valueName"... | Translate a PersistentObject list value.
@param $object The object whose value to translate
@param $valueName The name of the value to translate
@param $language The language to use
@param $itemDelim Delimiter string for array values (optional, default: ", ") | [
"Translate",
"a",
"PersistentObject",
"list",
"value",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L266-L272 |
26,681 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.removeNonDisplayValues | public static function removeNonDisplayValues(Node $node) {
$displayValues = $node->getProperty('displayValues');
$valueNames = $node->getValueNames();
foreach($valueNames as $name) {
if (!in_array($name, $displayValues)) {
$node->removeValue($name);
}
}
} | php | public static function removeNonDisplayValues(Node $node) {
$displayValues = $node->getProperty('displayValues');
$valueNames = $node->getValueNames();
foreach($valueNames as $name) {
if (!in_array($name, $displayValues)) {
$node->removeValue($name);
}
}
} | [
"public",
"static",
"function",
"removeNonDisplayValues",
"(",
"Node",
"$",
"node",
")",
"{",
"$",
"displayValues",
"=",
"$",
"node",
"->",
"getProperty",
"(",
"'displayValues'",
")",
";",
"$",
"valueNames",
"=",
"$",
"node",
"->",
"getValueNames",
"(",
")",... | Remove all values from a Node that are not a display value.
@param $node The Node instance | [
"Remove",
"all",
"values",
"from",
"a",
"Node",
"that",
"are",
"not",
"a",
"display",
"value",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L278-L286 |
26,682 | iherwig/wcmf | src/wcmf/lib/model/NodeUtil.php | NodeUtil.removeNonPkValues | public static function removeNonPkValues(Node $node) {
$mapper = $node->getMapper();
$pkValues = $mapper->getPkNames();
$valueNames = $node->getValueNames();
foreach($valueNames as $name) {
if (!in_array($name, $pkValues)) {
$node->removeValue($name);
}
}
} | php | public static function removeNonPkValues(Node $node) {
$mapper = $node->getMapper();
$pkValues = $mapper->getPkNames();
$valueNames = $node->getValueNames();
foreach($valueNames as $name) {
if (!in_array($name, $pkValues)) {
$node->removeValue($name);
}
}
} | [
"public",
"static",
"function",
"removeNonPkValues",
"(",
"Node",
"$",
"node",
")",
"{",
"$",
"mapper",
"=",
"$",
"node",
"->",
"getMapper",
"(",
")",
";",
"$",
"pkValues",
"=",
"$",
"mapper",
"->",
"getPkNames",
"(",
")",
";",
"$",
"valueNames",
"=",
... | Remove all values from a Node that are not a primary key value.
@param $node The Node instance | [
"Remove",
"all",
"values",
"from",
"a",
"Node",
"that",
"are",
"not",
"a",
"primary",
"key",
"value",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/NodeUtil.php#L292-L301 |
26,683 | iherwig/wcmf | src/wcmf/lib/presentation/impl/DefaultRequest.php | DefaultRequest.getBestRoute | protected function getBestRoute($routes) {
// order matching routes by number of parameters
$method = $this->getMethod();
usort($routes, function($a, $b) use ($method) {
$numParamsA = $a['numPathParameters'];
$numParamsB = $b['numPathParameters'];
if ($numParamsA == $numParamsB) {
... | php | protected function getBestRoute($routes) {
// order matching routes by number of parameters
$method = $this->getMethod();
usort($routes, function($a, $b) use ($method) {
$numParamsA = $a['numPathParameters'];
$numParamsB = $b['numPathParameters'];
if ($numParamsA == $numParamsB) {
... | [
"protected",
"function",
"getBestRoute",
"(",
"$",
"routes",
")",
"{",
"// order matching routes by number of parameters",
"$",
"method",
"=",
"$",
"this",
"->",
"getMethod",
"(",
")",
";",
"usort",
"(",
"$",
"routes",
",",
"function",
"(",
"$",
"a",
",",
"$... | Get the best matching route from the given list of routes
@param $routes Array of route definitions as returned by getMatchingRoutes()
@return Array with keys 'numPathParameters', 'parameters', 'methods' | [
"Get",
"the",
"best",
"matching",
"route",
"from",
"the",
"given",
"list",
"of",
"routes"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/impl/DefaultRequest.php#L333-L361 |
26,684 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.processHtml | public static function processHtml($content, callable $processor) {
$doc = new \DOMDocument();
$doc->loadHTML('<html>'.trim(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')).'</html>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$processor($doc);
return trim(str_replace(['<html>', '</html>'], ... | php | public static function processHtml($content, callable $processor) {
$doc = new \DOMDocument();
$doc->loadHTML('<html>'.trim(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')).'</html>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$processor($doc);
return trim(str_replace(['<html>', '</html>'], ... | [
"public",
"static",
"function",
"processHtml",
"(",
"$",
"content",
",",
"callable",
"$",
"processor",
")",
"{",
"$",
"doc",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"doc",
"->",
"loadHTML",
"(",
"'<html>'",
".",
"trim",
"(",
"mb_convert_enco... | Process the given html fragment using the given function
@param $content Html string
@param $processor Function that accepts a DOMDocument as only parameter
@return String | [
"Process",
"the",
"given",
"html",
"fragment",
"using",
"the",
"given",
"function"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L25-L30 |
26,685 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.getChildNodesOfName | public static function getChildNodesOfName(\DOMElement $element, $elementName) {
$result = [];
foreach ($element->childNodes as $child) {
if ($child->nodeName == $elementName) {
$result[] = $child;
}
}
return $result;
} | php | public static function getChildNodesOfName(\DOMElement $element, $elementName) {
$result = [];
foreach ($element->childNodes as $child) {
if ($child->nodeName == $elementName) {
$result[] = $child;
}
}
return $result;
} | [
"public",
"static",
"function",
"getChildNodesOfName",
"(",
"\\",
"DOMElement",
"$",
"element",
",",
"$",
"elementName",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"element",
"->",
"childNodes",
"as",
"$",
"child",
")",
"{",
"if",
... | Get the child nodes of a given element name
@param \DOMElement $element
@param $elementName
@return \DOMNodeList[] | [
"Get",
"the",
"child",
"nodes",
"of",
"a",
"given",
"element",
"name"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L38-L46 |
26,686 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.getNextSiblingOfType | public static function getNextSiblingOfType(\DOMElement $element, $elementType) {
$nextSibling = $element->nextSibling;
while ($nextSibling && $nextSibling->nodeType != $elementType) {
$nextSibling = $nextSibling->nextSibling;
}
return $nextSibling;
} | php | public static function getNextSiblingOfType(\DOMElement $element, $elementType) {
$nextSibling = $element->nextSibling;
while ($nextSibling && $nextSibling->nodeType != $elementType) {
$nextSibling = $nextSibling->nextSibling;
}
return $nextSibling;
} | [
"public",
"static",
"function",
"getNextSiblingOfType",
"(",
"\\",
"DOMElement",
"$",
"element",
",",
"$",
"elementType",
")",
"{",
"$",
"nextSibling",
"=",
"$",
"element",
"->",
"nextSibling",
";",
"while",
"(",
"$",
"nextSibling",
"&&",
"$",
"nextSibling",
... | Get the next sibling of the given element type
@param $element Reference element
@param $elementType Element type (e.g. XML_ELEMENT_NODE)
@return \DomElement | [
"Get",
"the",
"next",
"sibling",
"of",
"the",
"given",
"element",
"type"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L54-L60 |
26,687 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.getInnerHtml | public static function getInnerHtml(\DOMElement $element) {
$innerHTML= '';
$children = $element->childNodes;
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML( $child );
}
return $innerHTML;
} | php | public static function getInnerHtml(\DOMElement $element) {
$innerHTML= '';
$children = $element->childNodes;
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML( $child );
}
return $innerHTML;
} | [
"public",
"static",
"function",
"getInnerHtml",
"(",
"\\",
"DOMElement",
"$",
"element",
")",
"{",
"$",
"innerHTML",
"=",
"''",
";",
"$",
"children",
"=",
"$",
"element",
"->",
"childNodes",
";",
"foreach",
"(",
"$",
"children",
"as",
"$",
"child",
")",
... | Get the inner html string of an element
@param \DOMElement $element
@return String | [
"Get",
"the",
"inner",
"html",
"string",
"of",
"an",
"element"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L67-L74 |
26,688 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.setInnerHtml | public static function setInnerHtml(\DOMElement $element, $html) {
$fragment = $element->ownerDocument->createDocumentFragment();
$fragment->appendXML($html);
$element->appendChild($fragment);
} | php | public static function setInnerHtml(\DOMElement $element, $html) {
$fragment = $element->ownerDocument->createDocumentFragment();
$fragment->appendXML($html);
$element->appendChild($fragment);
} | [
"public",
"static",
"function",
"setInnerHtml",
"(",
"\\",
"DOMElement",
"$",
"element",
",",
"$",
"html",
")",
"{",
"$",
"fragment",
"=",
"$",
"element",
"->",
"ownerDocument",
"->",
"createDocumentFragment",
"(",
")",
";",
"$",
"fragment",
"->",
"appendXML... | Set the inner html string of an element
@param \DOMElement $element
@param $html | [
"Set",
"the",
"inner",
"html",
"string",
"of",
"an",
"element"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L81-L85 |
26,689 | iherwig/wcmf | src/wcmf/lib/util/DOMUtils.php | DOMUtils.removeEmptyLines | public static function removeEmptyLines($html) {
// merge multiple linebreaks to one
$html = preg_replace("/(<br>\s*)+/", "<br>", $html);
// remove linebreaks at the beginning of a paragraph
$html = preg_replace("/<p>(\s|<br>)*/", "<p>", $html);
// remove linebreaks at the end of a paragraph
$ht... | php | public static function removeEmptyLines($html) {
// merge multiple linebreaks to one
$html = preg_replace("/(<br>\s*)+/", "<br>", $html);
// remove linebreaks at the beginning of a paragraph
$html = preg_replace("/<p>(\s|<br>)*/", "<p>", $html);
// remove linebreaks at the end of a paragraph
$ht... | [
"public",
"static",
"function",
"removeEmptyLines",
"(",
"$",
"html",
")",
"{",
"// merge multiple linebreaks to one",
"$",
"html",
"=",
"preg_replace",
"(",
"\"/(<br>\\s*)+/\"",
",",
"\"<br>\"",
",",
"$",
"html",
")",
";",
"// remove linebreaks at the beginning of a pa... | Remove double linebreaks and empty paragraphs
@param $content
@return String | [
"Remove",
"double",
"linebreaks",
"and",
"empty",
"paragraphs"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/DOMUtils.php#L93-L103 |
26,690 | iherwig/wcmf | src/wcmf/lib/core/impl/DefaultFactory.php | DefaultFactory.resolveValue | protected function resolveValue($value) {
// special treatments, if value is a string
if (is_string($value)) {
// replace variables denoted by a leading $
if (strpos($value, '$') === 0) {
$value = $this->getInstance(preg_replace('/^\$/', '', $value));
}
else {
// convert ... | php | protected function resolveValue($value) {
// special treatments, if value is a string
if (is_string($value)) {
// replace variables denoted by a leading $
if (strpos($value, '$') === 0) {
$value = $this->getInstance(preg_replace('/^\$/', '', $value));
}
else {
// convert ... | [
"protected",
"function",
"resolveValue",
"(",
"$",
"value",
")",
"{",
"// special treatments, if value is a string",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"// replace variables denoted by a leading $",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",... | Resolve a configuration value into a parameter
@param $value
@return Mixed | [
"Resolve",
"a",
"configuration",
"value",
"into",
"a",
"parameter"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/impl/DefaultFactory.php#L331-L369 |
26,691 | iherwig/wcmf | src/wcmf/lib/core/impl/DefaultFactory.php | DefaultFactory.getInterface | protected function getInterface($name) {
if (isset($this->requiredInterfaces[$name])) {
return $this->requiredInterfaces[$name];
}
return null;
} | php | protected function getInterface($name) {
if (isset($this->requiredInterfaces[$name])) {
return $this->requiredInterfaces[$name];
}
return null;
} | [
"protected",
"function",
"getInterface",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"requiredInterfaces",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"requiredInterfaces",
"[",
"$",
"name",
"]",
";",
... | Get the interface that is required to be implemented by the given instance
@param $name The name of the instance
@return Interface or null, if undefined | [
"Get",
"the",
"interface",
"that",
"is",
"required",
"to",
"be",
"implemented",
"by",
"the",
"given",
"instance"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/core/impl/DefaultFactory.php#L376-L381 |
26,692 | iherwig/wcmf | src/wcmf/lib/security/impl/AbstractPermissionManager.php | AbstractPermissionManager.serializePermissions | protected function serializePermissions($permissions) {
$result = $permissions['default'] === true ? PermissionManager::PERMISSION_MODIFIER_ALLOW.'* ' :
PermissionManager::PERMISSION_MODIFIER_DENY.'* ';
if (isset($permissions['allow'])) {
foreach ($permissions['allow'] as $role) {
$result ... | php | protected function serializePermissions($permissions) {
$result = $permissions['default'] === true ? PermissionManager::PERMISSION_MODIFIER_ALLOW.'* ' :
PermissionManager::PERMISSION_MODIFIER_DENY.'* ';
if (isset($permissions['allow'])) {
foreach ($permissions['allow'] as $role) {
$result ... | [
"protected",
"function",
"serializePermissions",
"(",
"$",
"permissions",
")",
"{",
"$",
"result",
"=",
"$",
"permissions",
"[",
"'default'",
"]",
"===",
"true",
"?",
"PermissionManager",
"::",
"PERMISSION_MODIFIER_ALLOW",
".",
"'* '",
":",
"PermissionManager",
":... | Convert an associative permissions array with keys 'default', 'allow', 'deny'
into a string.
@param $permissions Associative array with keys 'default', 'allow', 'deny',
where 'allow', 'deny' are arrays itself holding roles and 'default' is a
boolean value derived from the wildcard policy (+* or -*).
@return A role stri... | [
"Convert",
"an",
"associative",
"permissions",
"array",
"with",
"keys",
"default",
"allow",
"deny",
"into",
"a",
"string",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/AbstractPermissionManager.php#L349-L363 |
26,693 | iherwig/wcmf | src/wcmf/lib/security/impl/AbstractPermissionManager.php | AbstractPermissionManager.matchRoles | protected function matchRoles($resource, $permissions, $login) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Matching roles for ".$login);
}
$user = $this->principalFactory->getUser($login, true);
if ($user != null) {
foreach (['allow' => true, 'deny' => false] as $key => $r... | php | protected function matchRoles($resource, $permissions, $login) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Matching roles for ".$login);
}
$user = $this->principalFactory->getUser($login, true);
if ($user != null) {
foreach (['allow' => true, 'deny' => false] as $key => $r... | [
"protected",
"function",
"matchRoles",
"(",
"$",
"resource",
",",
"$",
"permissions",
",",
"$",
"login",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
"->",
"isDebugEnabled",
"(",
")",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"debug",
"(",
"\... | Matches the roles of the user and the roles in the given permissions
@param $resource The resource string to authorize.
@param $permissions An array containing permissions as an associative array
with the keys 'default', 'allow', 'deny', where 'allow', 'deny' are arrays
itself holding roles and 'default' is a boolean v... | [
"Matches",
"the",
"roles",
"of",
"the",
"user",
"and",
"the",
"roles",
"in",
"the",
"given",
"permissions"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/AbstractPermissionManager.php#L375-L398 |
26,694 | iherwig/wcmf | src/wcmf/lib/security/impl/AbstractPermissionManager.php | AbstractPermissionManager.matchRole | protected function matchRole(User $user, $role, $resource) {
$isDynamicRole = isset($this->dynamicRoles[$role]);
return (($isDynamicRole && $this->dynamicRoles[$role]->match($user, $resource) === true)
|| (!$isDynamicRole && $user->hasRole($role)));
} | php | protected function matchRole(User $user, $role, $resource) {
$isDynamicRole = isset($this->dynamicRoles[$role]);
return (($isDynamicRole && $this->dynamicRoles[$role]->match($user, $resource) === true)
|| (!$isDynamicRole && $user->hasRole($role)));
} | [
"protected",
"function",
"matchRole",
"(",
"User",
"$",
"user",
",",
"$",
"role",
",",
"$",
"resource",
")",
"{",
"$",
"isDynamicRole",
"=",
"isset",
"(",
"$",
"this",
"->",
"dynamicRoles",
"[",
"$",
"role",
"]",
")",
";",
"return",
"(",
"(",
"$",
... | Check if a user matches the role for a resource
@param $user The user instance.
@param $role The role name.
@param $resource The resource string to authorize.
@return Boolean | [
"Check",
"if",
"a",
"user",
"matches",
"the",
"role",
"for",
"a",
"resource"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/security/impl/AbstractPermissionManager.php#L407-L411 |
26,695 | GW2Treasures/gw2api | src/V2/Endpoint/Continent/MapEndpoint.php | MapEndpoint.poisOf | public function poisOf( $map ) {
return new PoiEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | php | public function poisOf( $map ) {
return new PoiEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | [
"public",
"function",
"poisOf",
"(",
"$",
"map",
")",
"{",
"return",
"new",
"PoiEndpoint",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"continent",
",",
"$",
"this",
"->",
"floor",
",",
"$",
"this",
"->",
"region",
",",
"$",
"map",
")",
... | Get the maps points of interest.
@param int $map
@return PoiEndpoint | [
"Get",
"the",
"maps",
"points",
"of",
"interest",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Endpoint/Continent/MapEndpoint.php#L52-L54 |
26,696 | GW2Treasures/gw2api | src/V2/Endpoint/Continent/MapEndpoint.php | MapEndpoint.tasksOf | public function tasksOf( $map ) {
return new TaskEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | php | public function tasksOf( $map ) {
return new TaskEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | [
"public",
"function",
"tasksOf",
"(",
"$",
"map",
")",
"{",
"return",
"new",
"TaskEndpoint",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"continent",
",",
"$",
"this",
"->",
"floor",
",",
"$",
"this",
"->",
"region",
",",
"$",
"map",
")"... | Get the maps tasks.
@param int $map
@return TaskEndpoint | [
"Get",
"the",
"maps",
"tasks",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Endpoint/Continent/MapEndpoint.php#L63-L65 |
26,697 | GW2Treasures/gw2api | src/V2/Endpoint/Continent/MapEndpoint.php | MapEndpoint.sectorsOf | public function sectorsOf( $map ) {
return new SectorEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | php | public function sectorsOf( $map ) {
return new SectorEndpoint( $this->api, $this->continent, $this->floor, $this->region, $map );
} | [
"public",
"function",
"sectorsOf",
"(",
"$",
"map",
")",
"{",
"return",
"new",
"SectorEndpoint",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"continent",
",",
"$",
"this",
"->",
"floor",
",",
"$",
"this",
"->",
"region",
",",
"$",
"map",
... | Get the maps sectors.
@param int $map
@return SectorEndpoint | [
"Get",
"the",
"maps",
"sectors",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Endpoint/Continent/MapEndpoint.php#L74-L76 |
26,698 | iherwig/wcmf | src/wcmf/lib/pdf/PDF.php | PDF.numberOfLines | public function numberOfLines($width, $text) {
$nbLines = 0;
$lines = preg_split('/\n/', $text);
foreach ($lines as $line) {
$nbLines += $this->NbLines($width, $line);
}
return $nbLines;
} | php | public function numberOfLines($width, $text) {
$nbLines = 0;
$lines = preg_split('/\n/', $text);
foreach ($lines as $line) {
$nbLines += $this->NbLines($width, $line);
}
return $nbLines;
} | [
"public",
"function",
"numberOfLines",
"(",
"$",
"width",
",",
"$",
"text",
")",
"{",
"$",
"nbLines",
"=",
"0",
";",
"$",
"lines",
"=",
"preg_split",
"(",
"'/\\n/'",
",",
"$",
"text",
")",
";",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"line",
")",
... | Computes the number of lines a MultiCell of width w will take
instead of NbLines it correctly handles linebreaks
@param $width The width
@param $text The text | [
"Computes",
"the",
"number",
"of",
"lines",
"a",
"MultiCell",
"of",
"width",
"w",
"will",
"take",
"instead",
"of",
"NbLines",
"it",
"correctly",
"handles",
"linebreaks"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/pdf/PDF.php#L96-L103 |
26,699 | iherwig/wcmf | src/wcmf/lib/pdf/PDF.php | PDF.CheckPageBreak | public function CheckPageBreak($h) {
if($this->GetY()+$h>$this->PageBreakTrigger) {
$this->AddPage($this->CurOrientation);
return true;
}
return false;
} | php | public function CheckPageBreak($h) {
if($this->GetY()+$h>$this->PageBreakTrigger) {
$this->AddPage($this->CurOrientation);
return true;
}
return false;
} | [
"public",
"function",
"CheckPageBreak",
"(",
"$",
"h",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"GetY",
"(",
")",
"+",
"$",
"h",
">",
"$",
"this",
"->",
"PageBreakTrigger",
")",
"{",
"$",
"this",
"->",
"AddPage",
"(",
"$",
"this",
"->",
"CurOrientat... | If the height h would cause an overflow, add a new page immediately
@param $h The height
@return Boolean whether a new page was inserted or not | [
"If",
"the",
"height",
"h",
"would",
"cause",
"an",
"overflow",
"add",
"a",
"new",
"page",
"immediately"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/pdf/PDF.php#L115-L121 |
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.