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
29,800
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getIds
public function getIds(): array { $this->loadMetadata(); $ids = array(); foreach ($this->metadata->allResources(RC::idProp()) as $i) { $ids[] = $i->getUri(); } return $ids; }
php
public function getIds(): array { $this->loadMetadata(); $ids = array(); foreach ($this->metadata->allResources(RC::idProp()) as $i) { $ids[] = $i->getUri(); } return $ids; }
[ "public", "function", "getIds", "(", ")", ":", "array", "{", "$", "this", "->", "loadMetadata", "(", ")", ";", "$", "ids", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "metadata", "->", "allResources", "(", "RC", "::", "idProp", ...
Returns an array of resource's IDs. If you want to get an ACDH ID, use the getId() method. @return array @see getId()
[ "Returns", "an", "array", "of", "resource", "s", "IDs", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L205-L212
29,801
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.delete
public function delete(bool $deep = false, bool $children = false, bool $references = false) { $this->uri = $this->fedora->sanitizeUri($this->getUri()); $fedoraChildren = $this->getMetadata()->allResources(self::CONTAINS_PROP); if (count($fedoraChildren) > 0) { ...
php
public function delete(bool $deep = false, bool $children = false, bool $references = false) { $this->uri = $this->fedora->sanitizeUri($this->getUri()); $fedoraChildren = $this->getMetadata()->allResources(self::CONTAINS_PROP); if (count($fedoraChildren) > 0) { ...
[ "public", "function", "delete", "(", "bool", "$", "deep", "=", "false", ",", "bool", "$", "children", "=", "false", ",", "bool", "$", "references", "=", "false", ")", "{", "$", "this", "->", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri...
Removes the resource from the Fedora. Please remember searching for children and references is done using a SPARQL query so any changes made since the beginning of the transaction won't be taken into account. @param bool $deep should tombstone resource will be deleted? @param bool $children should children be removed?...
[ "Removes", "the", "resource", "from", "the", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L234-L284
29,802
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.move
public function move(string $destination): Response { $uri = $this->fedora->sanitizeUri($this->uri); $destination = $this->fedora->sanitizeUri($destination); $request = new Request('MOVE', $uri, ['Destination' => $destination]); $response = $this->fedora->sendRequest($requ...
php
public function move(string $destination): Response { $uri = $this->fedora->sanitizeUri($this->uri); $destination = $this->fedora->sanitizeUri($destination); $request = new Request('MOVE', $uri, ['Destination' => $destination]); $response = $this->fedora->sendRequest($requ...
[ "public", "function", "move", "(", "string", "$", "destination", ")", ":", "Response", "{", "$", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri", "(", "$", "this", "->", "uri", ")", ";", "$", "destination", "=", "$", "this", "->", "fedor...
Moves resource to another location. @param string $destination new location
[ "Moves", "resource", "to", "another", "location", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L291-L300
29,803
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getFixity
public function getFixity(): string { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri . '/fcr:fixity'); $resp = $this->fedora->sendRequest($request); $graph = new Graph(); $graph->parse($resp->getBody()); $res = $graph->...
php
public function getFixity(): string { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri . '/fcr:fixity'); $resp = $this->fedora->sendRequest($request); $graph = new Graph(); $graph->parse($resp->getBody()); $res = $graph->...
[ "public", "function", "getFixity", "(", ")", ":", "string", "{", "$", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri", "(", "$", "this", "->", "uri", ")", ";", "$", "request", "=", "new", "Request", "(", "'GET'", ",", "$", "uri", ".", ...
Returns resource fixity. @throws Deleted @throws NotFound @throws RequestException
[ "Returns", "resource", "fixity", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L308-L319
29,804
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.setMetadata
public function setMetadata(Resource $metadata, bool $fixReferences = false) { $this->metadata = $metadata; $this->updated = false; $this->extractAclFromMetadata(); $this->fedora->getCache()->reload($this); if ($fixReferences) { $this->fedora->fixMetadataReference...
php
public function setMetadata(Resource $metadata, bool $fixReferences = false) { $this->metadata = $metadata; $this->updated = false; $this->extractAclFromMetadata(); $this->fedora->getCache()->reload($this); if ($fixReferences) { $this->fedora->fixMetadataReference...
[ "public", "function", "setMetadata", "(", "Resource", "$", "metadata", ",", "bool", "$", "fixReferences", "=", "false", ")", "{", "$", "this", "->", "metadata", "=", "$", "metadata", ";", "$", "this", "->", "updated", "=", "false", ";", "$", "this", "-...
Replaces resource metadata with a given RDF graph. New metadata are not automatically written back to the Fedora. Use the updateMetadata() method to write them back. @param EasyRdf\Resource $metadata @param bool $fixReferences Should reference to other repository resources be switched into corresponding UUIDs? @see u...
[ "Replaces", "resource", "metadata", "with", "a", "given", "RDF", "graph", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L332-L343
29,805
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getMetadata
public function getMetadata(bool $force = false): Resource { $this->loadMetadata($force); return $this->metadata->copy(); }
php
public function getMetadata(bool $force = false): Resource { $this->loadMetadata($force); return $this->metadata->copy(); }
[ "public", "function", "getMetadata", "(", "bool", "$", "force", "=", "false", ")", ":", "Resource", "{", "$", "this", "->", "loadMetadata", "(", "$", "force", ")", ";", "return", "$", "this", "->", "metadata", "->", "copy", "(", ")", ";", "}" ]
Returns resource metadata. Fetches them from the Fedora if they were not fetched already. A deep copy of metadata is returned meaning adjusting the returned object does not automatically affect the resource metadata. Use the setMetadata() method to write back the changes you made. @param bool $force enforce fetch fr...
[ "Returns", "resource", "metadata", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L435-L438
29,806
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.loadMetadata
protected function loadMetadata(bool $force = false) { if (!$this->metadata || $force) { $meta = $this->getMetadataFromFedora(); if (count($meta->propertyUris()) === 0) { throw new RuntimeException('No resource metadata. Please check a value of the fedoraApiUrl configura...
php
protected function loadMetadata(bool $force = false) { if (!$this->metadata || $force) { $meta = $this->getMetadataFromFedora(); if (count($meta->propertyUris()) === 0) { throw new RuntimeException('No resource metadata. Please check a value of the fedoraApiUrl configura...
[ "protected", "function", "loadMetadata", "(", "bool", "$", "force", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "metadata", "||", "$", "force", ")", "{", "$", "meta", "=", "$", "this", "->", "getMetadataFromFedora", "(", ")", ";", "if"...
Loads current metadata from the Fedora. @param bool $force enforce fetch from Fedora (when you want to make sure metadata are in line with ones in the Fedora or e.g. reset them back to their current state in Fedora)
[ "Loads", "current", "metadata", "from", "the", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L447-L457
29,807
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getMetadataFromFedora
private function getMetadataFromFedora(): Resource { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri . '/fcr:metadata', ['Accept' => 'application/n-triples']); $resp = $this->fedora->sendRequest($request); $format = ''; $headers = $resp-...
php
private function getMetadataFromFedora(): Resource { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri . '/fcr:metadata', ['Accept' => 'application/n-triples']); $resp = $this->fedora->sendRequest($request); $format = ''; $headers = $resp-...
[ "private", "function", "getMetadataFromFedora", "(", ")", ":", "Resource", "{", "$", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri", "(", "$", "this", "->", "uri", ")", ";", "$", "request", "=", "new", "Request", "(", "'GET'", ",", "$", ...
Fetches metadata from Fedora. @return Resource @throws RequestException @throws Deleted
[ "Fetches", "metadata", "from", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L465-L482
29,808
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getContent
public function getContent(): Response { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri); return $this->fedora->sendRequest($request); }
php
public function getContent(): Response { $uri = $this->fedora->sanitizeUri($this->uri); $request = new Request('GET', $uri); return $this->fedora->sendRequest($request); }
[ "public", "function", "getContent", "(", ")", ":", "Response", "{", "$", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri", "(", "$", "this", "->", "uri", ")", ";", "$", "request", "=", "new", "Request", "(", "'GET'", ",", "$", "uri", ")...
Returns resource's binary content. @return Response PSR-7 response containing resource's binary content
[ "Returns", "resource", "s", "binary", "content", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L488-L492
29,809
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.updateContent
public function updateContent($data, bool $convert = false) { if (empty($data)) { return; } $this->loadMetadata(); if ($this->isA('http://www.w3.org/ns/ldp#NonRDFSource')) { $request = new Request('PUT', $this->getUri()); $request = Fedora::attachData(...
php
public function updateContent($data, bool $convert = false) { if (empty($data)) { return; } $this->loadMetadata(); if ($this->isA('http://www.w3.org/ns/ldp#NonRDFSource')) { $request = new Request('PUT', $this->getUri()); $request = Fedora::attachData(...
[ "public", "function", "updateContent", "(", "$", "data", ",", "bool", "$", "convert", "=", "false", ")", "{", "if", "(", "empty", "(", "$", "data", ")", ")", "{", "return", ";", "}", "$", "this", "->", "loadMetadata", "(", ")", ";", "if", "(", "$...
Updates resource binary content in the Fedora. If the resource is not a binary resource (in Fedora terms), it can be converted. This means the existing Fedora resource will be deleted and the new one will be created. This means the resource will change its Fedora URI but the id property indicated by the "fedoraIdProp"...
[ "Updates", "resource", "binary", "content", "in", "the", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L514-L537
29,810
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getFedoraChildren
public function getFedoraChildren(): array { $children = []; foreach ($this->getMetadata()->allResources(self::CONTAINS_PROP) as $i) { $children[] = $this->fedora->getResourceByUri($i->getUri()); } return $children; }
php
public function getFedoraChildren(): array { $children = []; foreach ($this->getMetadata()->allResources(self::CONTAINS_PROP) as $i) { $children[] = $this->fedora->getResourceByUri($i->getUri()); } return $children; }
[ "public", "function", "getFedoraChildren", "(", ")", ":", "array", "{", "$", "children", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getMetadata", "(", ")", "->", "allResources", "(", "self", "::", "CONTAINS_PROP", ")", "as", "$", "i", ")",...
Returns all resource's Fedora children. A Fedora child is a resource pointed by the ldp:contains triple. All Fedora children URIs are nested in the parent's URI path but the deepness of such nesting can vary (e.g. both http://a/b and http://a/b/c/d can be Fedora children of the http://a depenging on how they were crea...
[ "Returns", "all", "resource", "s", "Fedora", "children", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L612-L618
29,811
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getChildrenByProperty
public function getChildrenByProperty(string $property, string $value = ''): array { $query = $this->getChildrenQuery(); if ($value != '') { $param = new HasValue($property, $value); } else { $param = new HasProperty($property); } $query->addParameter($par...
php
public function getChildrenByProperty(string $property, string $value = ''): array { $query = $this->getChildrenQuery(); if ($value != '') { $param = new HasValue($property, $value); } else { $param = new HasProperty($property); } $query->addParameter($par...
[ "public", "function", "getChildrenByProperty", "(", "string", "$", "property", ",", "string", "$", "value", "=", "''", ")", ":", "array", "{", "$", "query", "=", "$", "this", "->", "getChildrenQuery", "(", ")", ";", "if", "(", "$", "value", "!=", "''",...
Returns all resource's children having a given property or a given value of a given property. It is assumed that child-parent relations are denoted by: `child -> config::relProp -> id <- config::idProp <- parent` metadata properties scheme. @param string $property fully qualified URI of the property @param string $va...
[ "Returns", "all", "resource", "s", "children", "having", "a", "given", "property", "or", "a", "given", "value", "of", "a", "given", "property", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L645-L654
29,812
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getChildrenByPropertyRegEx
public function getChildrenByPropertyRegEx(string $property, string $regEx, string $flags = 'i'): array { $query = $this->getChildrenQuery(); $query->addParameter(new MatchesRegEx($property, $regEx, $flags)); return $this->fedora->getResourcesByQuer...
php
public function getChildrenByPropertyRegEx(string $property, string $regEx, string $flags = 'i'): array { $query = $this->getChildrenQuery(); $query->addParameter(new MatchesRegEx($property, $regEx, $flags)); return $this->fedora->getResourcesByQuer...
[ "public", "function", "getChildrenByPropertyRegEx", "(", "string", "$", "property", ",", "string", "$", "regEx", ",", "string", "$", "flags", "=", "'i'", ")", ":", "array", "{", "$", "query", "=", "$", "this", "->", "getChildrenQuery", "(", ")", ";", "$"...
Returns all resource's children with a given property matching a given regular expression It is assumed that child-parent relations are denoted by: `child -> config::relProp -> id <- config::idProp <- parent` metadata properties scheme. @param string $property fully qualified URI of the property @param string $regEx ...
[ "Returns", "all", "resource", "s", "children", "with", "a", "given", "property", "matching", "a", "given", "regular", "expression" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L669-L674
29,813
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getAclUrl
public function getAclUrl(bool $refresh = false): string { if ($refresh || $this->aclUrl === null) { $request = new Request('HEAD', $this->fedora->sanitizeUri($this->uri)); $response = $this->fedora->sendRequest($request); $this->extractAcl($response); // Fedora...
php
public function getAclUrl(bool $refresh = false): string { if ($refresh || $this->aclUrl === null) { $request = new Request('HEAD', $this->fedora->sanitizeUri($this->uri)); $response = $this->fedora->sendRequest($request); $this->extractAcl($response); // Fedora...
[ "public", "function", "getAclUrl", "(", "bool", "$", "refresh", "=", "false", ")", ":", "string", "{", "if", "(", "$", "refresh", "||", "$", "this", "->", "aclUrl", "===", "null", ")", "{", "$", "request", "=", "new", "Request", "(", "'HEAD'", ",", ...
Returns URL of the resources' ACL collection @param bool $refresh should ACL URL be reread @return string
[ "Returns", "URL", "of", "the", "resources", "ACL", "collection" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L681-L697
29,814
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getAcl
public function getAcl(bool $refresh = true): WebAcl { if ($refresh || $this->acl === null) { $this->getAclUrl($refresh); $this->acl = new WebAcl($this); } return $this->acl; }
php
public function getAcl(bool $refresh = true): WebAcl { if ($refresh || $this->acl === null) { $this->getAclUrl($refresh); $this->acl = new WebAcl($this); } return $this->acl; }
[ "public", "function", "getAcl", "(", "bool", "$", "refresh", "=", "true", ")", ":", "WebAcl", "{", "if", "(", "$", "refresh", "||", "$", "this", "->", "acl", "===", "null", ")", "{", "$", "this", "->", "getAclUrl", "(", "$", "refresh", ")", ";", ...
Returns a WebAcl object for access rules manipulation. @param bool $refresh should the ACL collection and rules be refreshed or read from cache (there are many scenarios when reading requiring ACL data to be outdated so the default behaviour is to refresh) @return WebAcl
[ "Returns", "a", "WebAcl", "object", "for", "access", "rules", "manipulation", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L706-L712
29,815
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/FedoraResource.php
FedoraResource.getSparqlTriples
private function getSparqlTriples(Resource $metadata): string { $uri = $this->fedora->sanitizeUri($this->uri); $res = $metadata->copy(self::$skipProp, self::$skipPropRegExp, $uri); // make sure the ACL property is in current transaction $aclProp = $res->getResource(WebAcl::ACL_LINK_PROP...
php
private function getSparqlTriples(Resource $metadata): string { $uri = $this->fedora->sanitizeUri($this->uri); $res = $metadata->copy(self::$skipProp, self::$skipPropRegExp, $uri); // make sure the ACL property is in current transaction $aclProp = $res->getResource(WebAcl::ACL_LINK_PROP...
[ "private", "function", "getSparqlTriples", "(", "Resource", "$", "metadata", ")", ":", "string", "{", "$", "uri", "=", "$", "this", "->", "fedora", "->", "sanitizeUri", "(", "$", "this", "->", "uri", ")", ";", "$", "res", "=", "$", "metadata", "->", ...
Serializes metadata to a form suitable for Fedora's SPARQL-update query. This means the "ntriples" format with subject URIs compliant with current Fedora connection and excluding properties Fedora reserves for itself (and rises errors when they are provided from the outside). @param \EasyRdf\Resource $metadata metada...
[ "Serializes", "metadata", "to", "a", "form", "suitable", "for", "Fedora", "s", "SPARQL", "-", "update", "query", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/FedoraResource.php#L824-L839
29,816
secucard/secucard-connect-php-sdk
src/SecucardConnect/Product/Loyalty/CardGroupsService.php
CardGroupsService.checkPasscodeEnabled
public function checkPasscodeEnabled($cardGroupId, $transactionType, $cardNumber) { return $this->execute($cardGroupId, "checkPasscodeEnabled", null, ["action" => $transactionType, "cardnumber" => $cardNumber]); }
php
public function checkPasscodeEnabled($cardGroupId, $transactionType, $cardNumber) { return $this->execute($cardGroupId, "checkPasscodeEnabled", null, ["action" => $transactionType, "cardnumber" => $cardNumber]); }
[ "public", "function", "checkPasscodeEnabled", "(", "$", "cardGroupId", ",", "$", "transactionType", ",", "$", "cardNumber", ")", "{", "return", "$", "this", "->", "execute", "(", "$", "cardGroupId", ",", "\"checkPasscodeEnabled\"", ",", "null", ",", "[", "\"ac...
Check if a passcode is enabled for this card @param string $cardGroupId CRG_XYZ @param string $transactionType FORM_TRANSACTION_XYZ @param string $cardNumber Number of the card @return bool|null @throws GuzzleException @throws ApiError @throws AuthError @throws ClientError
[ "Check", "if", "a", "passcode", "is", "enabled", "for", "this", "card" ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Product/Loyalty/CardGroupsService.php#L29-L32
29,817
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/SchemaObject.php
SchemaObject.getResource
public function getResource(bool $create = true, bool $uploadBinary = true): FedoraResource { if ($this->res === null) { try { $this->findResource(false, false); } catch (NotFound $e) { $this->updateRms($create, $uploadBinary); } } ...
php
public function getResource(bool $create = true, bool $uploadBinary = true): FedoraResource { if ($this->res === null) { try { $this->findResource(false, false); } catch (NotFound $e) { $this->updateRms($create, $uploadBinary); } } ...
[ "public", "function", "getResource", "(", "bool", "$", "create", "=", "true", ",", "bool", "$", "uploadBinary", "=", "true", ")", ":", "FedoraResource", "{", "if", "(", "$", "this", "->", "res", "===", "null", ")", "{", "try", "{", "$", "this", "->",...
Returns repository resource representing given real-world entity. If it does not exist, it can be created. @param bool $create should repository resource be created if it does not exist? @param bool $uploadBinary should binary data of the real-world entity be uploaded uppon repository resource creation? @return Fedor...
[ "Returns", "repository", "resource", "representing", "given", "real", "-", "world", "entity", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/SchemaObject.php#L129-L138
29,818
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/SchemaObject.php
SchemaObject.getIds
public function getIds(): array { $ids = array($this->id); $meta = $this->getMetadata(); foreach ($meta->allResources(RC::idProp()) as $id) { $ids[] = $id->getUri(); } $ids = array_unique($ids); return $ids; }
php
public function getIds(): array { $ids = array($this->id); $meta = $this->getMetadata(); foreach ($meta->allResources(RC::idProp()) as $id) { $ids[] = $id->getUri(); } $ids = array_unique($ids); return $ids; }
[ "public", "function", "getIds", "(", ")", ":", "array", "{", "$", "ids", "=", "array", "(", "$", "this", "->", "id", ")", ";", "$", "meta", "=", "$", "this", "->", "getMetadata", "(", ")", ";", "foreach", "(", "$", "meta", "->", "allResources", "...
Returns all known ids @return array list of all ids
[ "Returns", "all", "known", "ids" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/SchemaObject.php#L157-L165
29,819
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/SchemaObject.php
SchemaObject.updateRms
public function updateRms(bool $create = true, bool $uploadBinary = true, string $path = '/'): FedoraResource { $this->created = $this->findResource($create, $uploadBinary, $path); // if it has just been created it would be a waste of time to update it if (!$this->...
php
public function updateRms(bool $create = true, bool $uploadBinary = true, string $path = '/'): FedoraResource { $this->created = $this->findResource($create, $uploadBinary, $path); // if it has just been created it would be a waste of time to update it if (!$this->...
[ "public", "function", "updateRms", "(", "bool", "$", "create", "=", "true", ",", "bool", "$", "uploadBinary", "=", "true", ",", "string", "$", "path", "=", "'/'", ")", ":", "FedoraResource", "{", "$", "this", "->", "created", "=", "$", "this", "->", ...
Updates repository resource representing a real-world entity stored in this object. @param bool $create should repository resource be created if it does not exist? @param bool $uploadBinary should binary data of the real-world entity be uploaded uppon repository resource creation? @param string $path where to create a...
[ "Updates", "repository", "resource", "representing", "a", "real", "-", "world", "entity", "stored", "in", "this", "object", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/SchemaObject.php#L181-L203
29,820
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/SchemaObject.php
SchemaObject.setMetadata
public function setMetadata(Resource $meta, array $preserve = array()) { $this->metadata = $meta; $this->metadataPreserve = $preserve; }
php
public function setMetadata(Resource $meta, array $preserve = array()) { $this->metadata = $meta; $this->metadataPreserve = $preserve; }
[ "public", "function", "setMetadata", "(", "Resource", "$", "meta", ",", "array", "$", "preserve", "=", "array", "(", ")", ")", "{", "$", "this", "->", "metadata", "=", "$", "meta", ";", "$", "this", "->", "metadataPreserve", "=", "$", "preserve", ";", ...
Sets an external metadata to be appended to automatically generated ones. If a given metatada property exists both in automatically generated and provided metadata, then the final result depends on the $preserve parameter: - if the property is listed in the $preserve array, both automatically generated and provided va...
[ "Sets", "an", "external", "metadata", "to", "be", "appended", "to", "automatically", "generated", "ones", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/SchemaObject.php#L231-L234
29,821
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/SchemaObject.php
SchemaObject.findResource
protected function findResource(bool $create = true, bool $uploadBinary = true, string $path = ''): bool { $ids = $this->getIds(); echo self::$debug ? "searching for " . implode(', ', $ids) . "\n" : ""; $result = ''; try { $this->res = ...
php
protected function findResource(bool $create = true, bool $uploadBinary = true, string $path = ''): bool { $ids = $this->getIds(); echo self::$debug ? "searching for " . implode(', ', $ids) . "\n" : ""; $result = ''; try { $this->res = ...
[ "protected", "function", "findResource", "(", "bool", "$", "create", "=", "true", ",", "bool", "$", "uploadBinary", "=", "true", ",", "string", "$", "path", "=", "''", ")", ":", "bool", "{", "$", "ids", "=", "$", "this", "->", "getIds", "(", ")", "...
Tries to find a repository resource representing a given object. @param bool $create should repository resource be created if it was not found? @param bool $uploadBinary should binary data of the real-world entity be uploaded uppon repository resource creation? @param string $path where to create a resource (if it doe...
[ "Tries", "to", "find", "a", "repository", "resource", "representing", "a", "given", "object", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/SchemaObject.php#L249-L273
29,822
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Match.php
Match.getMetadata
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addResource(RC::relProp(), $this->service->getResource()->getId()); $meta->addResource(RC::idProp(), $this->getId()); $meta->addLiteral(RC::titleProp(), 'A dissemination service matching rule'); ...
php
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addResource(RC::relProp(), $this->service->getResource()->getId()); $meta->addResource(RC::idProp(), $this->getId()); $meta->addLiteral(RC::titleProp(), 'A dissemination service matching rule'); ...
[ "public", "function", "getMetadata", "(", ")", ":", "Resource", "{", "$", "meta", "=", "(", "new", "Graph", "(", ")", ")", "->", "resource", "(", "'.'", ")", ";", "$", "meta", "->", "addResource", "(", "RC", "::", "relProp", "(", ")", ",", "$", "...
Returns metadata describing the match @return Resource
[ "Returns", "metadata", "describing", "the", "match" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Match.php#L119-L131
29,823
polyfony-inc/polyfony
Private/Polyfony/Record.php
Record.tget
public function tget(string $column, int $length=32) { // we get the raw value, truncate it, and escape it afterwards return strlen($this->get($column, true)) > $length ? Format::htmlSafe( Format::truncate( $this->get($column, true), $length ) ) : $this->get($column); }
php
public function tget(string $column, int $length=32) { // we get the raw value, truncate it, and escape it afterwards return strlen($this->get($column, true)) > $length ? Format::htmlSafe( Format::truncate( $this->get($column, true), $length ) ) : $this->get($column); }
[ "public", "function", "tget", "(", "string", "$", "column", ",", "int", "$", "length", "=", "32", ")", "{", "// we get the raw value, truncate it, and escape it afterwards", "return", "strlen", "(", "$", "this", "->", "get", "(", "$", "column", ",", "true", ")...
get a truncated field, that is safe to place in a HTML document
[ "get", "a", "truncated", "field", "that", "is", "safe", "to", "place", "in", "a", "HTML", "document" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Record.php#L8-L18
29,824
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.validateGraph
static public function validateGraph(Graph $graph, Fedora $fedora): array { $results = array(); foreach ($graph->resources() as $i) { $results = array_merge($results, self::validateResource($i, $fedora)); } return $results; }
php
static public function validateGraph(Graph $graph, Fedora $fedora): array { $results = array(); foreach ($graph->resources() as $i) { $results = array_merge($results, self::validateResource($i, $fedora)); } return $results; }
[ "static", "public", "function", "validateGraph", "(", "Graph", "$", "graph", ",", "Fedora", "$", "fedora", ")", ":", "array", "{", "$", "results", "=", "array", "(", ")", ";", "foreach", "(", "$", "graph", "->", "resources", "(", ")", "as", "$", "i",...
Checks a given RDF graph against ontology in a given Fedora repository. @param Graph $graph RDF graph to be checked @param Fedora $fedora repository connection object @return array list of errors
[ "Checks", "a", "given", "RDF", "graph", "against", "ontology", "in", "a", "given", "Fedora", "repository", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L71-L77
29,825
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.validateResource
static public function validateResource(Resource $res, Fedora $fedora): array { $results = array(); foreach ($res->propertyUris() as $prop) { if ($prop === self::RDFS_TYPE) { $tmp = self::checkClass($res, $fedora); } else { $tmp = self::checkProper...
php
static public function validateResource(Resource $res, Fedora $fedora): array { $results = array(); foreach ($res->propertyUris() as $prop) { if ($prop === self::RDFS_TYPE) { $tmp = self::checkClass($res, $fedora); } else { $tmp = self::checkProper...
[ "static", "public", "function", "validateResource", "(", "Resource", "$", "res", ",", "Fedora", "$", "fedora", ")", ":", "array", "{", "$", "results", "=", "array", "(", ")", ";", "foreach", "(", "$", "res", "->", "propertyUris", "(", ")", "as", "$", ...
Checks a given EasyRdf\Resource against ontology in a given repository. @param Resource $res @param Fedora $fedora repository connection object @return array list of errors
[ "Checks", "a", "given", "EasyRdf", "\\", "Resource", "against", "ontology", "in", "a", "given", "repository", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L85-L96
29,826
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.printResults
static public function printResults(array $results, string $format = 'text') { if ($format == 'tsv') { echo "subject\tmessage\tproperty\tvalue\n"; foreach ($results as $i) { echo $i . "\n"; } } else { $len = array(9, 9, 10, 7); ...
php
static public function printResults(array $results, string $format = 'text') { if ($format == 'tsv') { echo "subject\tmessage\tproperty\tvalue\n"; foreach ($results as $i) { echo $i . "\n"; } } else { $len = array(9, 9, 10, 7); ...
[ "static", "public", "function", "printResults", "(", "array", "$", "results", ",", "string", "$", "format", "=", "'text'", ")", "{", "if", "(", "$", "format", "==", "'tsv'", ")", "{", "echo", "\"subject\\tmessage\\tproperty\\tvalue\\n\"", ";", "foreach", "(", ...
Pretty prints a list of errors. @param array $results list of errors @param string $format print format: tsv or text
[ "Pretty", "prints", "a", "list", "of", "errors", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L113-L133
29,827
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.checkClass
static private function checkClass(Resource $res, Fedora $fedora): array { if (self::$classes === null) { self::loadClasses($fedora); } $ret = array(); foreach ($res->allResources(self::RDFS_TYPE) as $i) { $i = $i->getUri(); if (!isset(self::$classes[$...
php
static private function checkClass(Resource $res, Fedora $fedora): array { if (self::$classes === null) { self::loadClasses($fedora); } $ret = array(); foreach ($res->allResources(self::RDFS_TYPE) as $i) { $i = $i->getUri(); if (!isset(self::$classes[$...
[ "static", "private", "function", "checkClass", "(", "Resource", "$", "res", ",", "Fedora", "$", "fedora", ")", ":", "array", "{", "if", "(", "self", "::", "$", "classes", "===", "null", ")", "{", "self", "::", "loadClasses", "(", "$", "fedora", ")", ...
Checks if a resource is of known class @param Resource $res resource to be checked @param Fedora $fedora repository connection object @return array list of errors
[ "Checks", "if", "a", "resource", "is", "of", "known", "class" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L141-L153
29,828
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.checkProperty
static private function checkProperty(string $property, Resource $res, Fedora $fedora): array { $uri = $res->getUri(); $ret = array(); try { $propDef = self::getPropertyDef($property, $fedora); if (!self::checkRangeDomain($res, $...
php
static private function checkProperty(string $property, Resource $res, Fedora $fedora): array { $uri = $res->getUri(); $ret = array(); try { $propDef = self::getPropertyDef($property, $fedora); if (!self::checkRangeDomain($res, $...
[ "static", "private", "function", "checkProperty", "(", "string", "$", "property", ",", "Resource", "$", "res", ",", "Fedora", "$", "fedora", ")", ":", "array", "{", "$", "uri", "=", "$", "res", "->", "getUri", "(", ")", ";", "$", "ret", "=", "array",...
Checks if a given property is defined in the ontology and if all its values for a given resource match property definition provided by the ontology. @param string $property RDF property to be checked @param Resource $res resource containing given property values @param Fedora $fedora repository connection object @retur...
[ "Checks", "if", "a", "given", "property", "is", "defined", "in", "the", "ontology", "and", "if", "all", "its", "values", "for", "a", "given", "resource", "match", "property", "definition", "provided", "by", "the", "ontology", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L165-L201
29,829
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.getPropertyDef
static private function getPropertyDef(string $property, Fedora $fedora): OntologyProperty { if (!isset(self::$cache[$property])) { self::$cache[$property] = new OntologyProperty($property, $fedora); } return self::$cache[$property]; }
php
static private function getPropertyDef(string $property, Fedora $fedora): OntologyProperty { if (!isset(self::$cache[$property])) { self::$cache[$property] = new OntologyProperty($property, $fedora); } return self::$cache[$property]; }
[ "static", "private", "function", "getPropertyDef", "(", "string", "$", "property", ",", "Fedora", "$", "fedora", ")", ":", "OntologyProperty", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "cache", "[", "$", "property", "]", ")", ")", "{", "sel...
Fetches property definition from cache. Creates a deifinition if it does not exist. @param string $property RDF property URI @param Fedora $fedora repository connection object @return \acdhOeaw\util\metadataValidator\OntologyProperty
[ "Fetches", "property", "definition", "from", "cache", ".", "Creates", "a", "deifinition", "if", "it", "does", "not", "exist", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L210-L215
29,830
acdh-oeaw/repo-php-util
src/acdhOeaw/util/metadataValidator/MetadataValidator.php
MetadataValidator.loadClasses
static private function loadClasses(Fedora $fedora) { $ontologyLoc = RC::get('fedoraApiUrl') . '/' . RC::get('doorkeeperOntologyLocation') . '/'; $query = new SimpleQuery(" select ?fRes ?id ?parent where { ?fRes a <http://www.w3.org/2002/07/owl#Class> . ...
php
static private function loadClasses(Fedora $fedora) { $ontologyLoc = RC::get('fedoraApiUrl') . '/' . RC::get('doorkeeperOntologyLocation') . '/'; $query = new SimpleQuery(" select ?fRes ?id ?parent where { ?fRes a <http://www.w3.org/2002/07/owl#Class> . ...
[ "static", "private", "function", "loadClasses", "(", "Fedora", "$", "fedora", ")", "{", "$", "ontologyLoc", "=", "RC", "::", "get", "(", "'fedoraApiUrl'", ")", ".", "'/'", ".", "RC", "::", "get", "(", "'doorkeeperOntologyLocation'", ")", ".", "'/'", ";", ...
Loads classes defined in the ontology. @param Fedora $fedora repository connection object
[ "Loads", "classes", "defined", "in", "the", "ontology", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/metadataValidator/MetadataValidator.php#L251-L276
29,831
polyfony-inc/polyfony
Private/Polyfony/Database.php
Database.describe
public static function describe(string $table) :array { // set the cachefile name $cache_name = ucfirst($table).'Nulls'; // check if it has been cached already if(Cache::has($cache_name)) { // get it from the cache return Cache::get($cache_name); } // else it is not available from the cache else...
php
public static function describe(string $table) :array { // set the cachefile name $cache_name = ucfirst($table).'Nulls'; // check if it has been cached already if(Cache::has($cache_name)) { // get it from the cache return Cache::get($cache_name); } // else it is not available from the cache else...
[ "public", "static", "function", "describe", "(", "string", "$", "table", ")", ":", "array", "{", "// set the cachefile name", "$", "cache_name", "=", "ucfirst", "(", "$", "table", ")", ".", "'Nulls'", ";", "// check if it has been cached already", "if", "(", "Ca...
get the description of a table
[ "get", "the", "description", "of", "a", "table" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Database.php#L181-L218
29,832
polyfony-inc/polyfony
Private/Polyfony/Controller.php
Controller.forward
final public function forward(string $controller, $action = null) :void { // get the current route as a base $route = Router::getCurrentRoute(); // and alter it $route->controller = $controller; $route->action = $action; // forward to the new route Router::forward($route); }
php
final public function forward(string $controller, $action = null) :void { // get the current route as a base $route = Router::getCurrentRoute(); // and alter it $route->controller = $controller; $route->action = $action; // forward to the new route Router::forward($route); }
[ "final", "public", "function", "forward", "(", "string", "$", "controller", ",", "$", "action", "=", "null", ")", ":", "void", "{", "// get the current route as a base", "$", "route", "=", "Router", "::", "getCurrentRoute", "(", ")", ";", "// and alter it", "$...
forward to another controller in the same bundle
[ "forward", "to", "another", "controller", "in", "the", "same", "bundle" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Controller.php#L56-L68
29,833
ventoviro/windwalker-core
src/Core/Utilities/Classes/ArrayAccessTrait.php
ArrayAccessTrait.offsetGet
public function offsetGet($offset) { $field = $this->dataField; if (empty($this->{$field}[$offset])) { return null; } return $this->{$field}[$offset]; }
php
public function offsetGet($offset) { $field = $this->dataField; if (empty($this->{$field}[$offset])) { return null; } return $this->{$field}[$offset]; }
[ "public", "function", "offsetGet", "(", "$", "offset", ")", "{", "$", "field", "=", "$", "this", "->", "dataField", ";", "if", "(", "empty", "(", "$", "this", "->", "{", "$", "field", "}", "[", "$", "offset", "]", ")", ")", "{", "return", "null",...
Get a value of property. @param mixed $offset Property key. @return mixed The value of this property.
[ "Get", "a", "value", "of", "property", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Utilities/Classes/ArrayAccessTrait.php#L46-L55
29,834
ventoviro/windwalker-core
src/Core/Utilities/Classes/ArrayAccessTrait.php
ArrayAccessTrait.offsetSet
public function offsetSet($offset, $value) { $field = $this->dataField; if ($offset !== null) { $this->{$field}[$offset] = $value; } else { array_push($this->{$field}, $value); } }
php
public function offsetSet($offset, $value) { $field = $this->dataField; if ($offset !== null) { $this->{$field}[$offset] = $value; } else { array_push($this->{$field}, $value); } }
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", "{", "$", "field", "=", "$", "this", "->", "dataField", ";", "if", "(", "$", "offset", "!==", "null", ")", "{", "$", "this", "->", "{", "$", "field", "}", "[", "$", ...
Set value to property @param mixed $offset Property key. @param mixed $value Property value to set. @return void
[ "Set", "value", "to", "property" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Utilities/Classes/ArrayAccessTrait.php#L65-L74
29,835
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/metadataQuery/QueryParameter.php
QueryParameter.escapeUri
static public function escapeUri(string $uri): string { self::initSerializer(); return self::$serializer->serialiseValue(new Resource($uri)); }
php
static public function escapeUri(string $uri): string { self::initSerializer(); return self::$serializer->serialiseValue(new Resource($uri)); }
[ "static", "public", "function", "escapeUri", "(", "string", "$", "uri", ")", ":", "string", "{", "self", "::", "initSerializer", "(", ")", ";", "return", "self", "::", "$", "serializer", "->", "serialiseValue", "(", "new", "Resource", "(", "$", "uri", ")...
Escapes a given string as an URI @param string $uri @return string
[ "Escapes", "a", "given", "string", "as", "an", "URI" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/metadataQuery/QueryParameter.php#L68-L71
29,836
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/metadataQuery/QueryParameter.php
QueryParameter.escapeLiteral
static public function escapeLiteral(string $literal): string { self::initSerializer(); $value = self::$serializer->serialiseValue(new Literal($literal)); return $value; }
php
static public function escapeLiteral(string $literal): string { self::initSerializer(); $value = self::$serializer->serialiseValue(new Literal($literal)); return $value; }
[ "static", "public", "function", "escapeLiteral", "(", "string", "$", "literal", ")", ":", "string", "{", "self", "::", "initSerializer", "(", ")", ";", "$", "value", "=", "self", "::", "$", "serializer", "->", "serialiseValue", "(", "new", "Literal", "(", ...
Escapes a given string as a literal @param string $literal @return string
[ "Escapes", "a", "given", "string", "as", "a", "literal" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/metadataQuery/QueryParameter.php#L79-L83
29,837
hnhdigital-os/laravel-model-schema
src/Exceptions/ValidationException.php
ValidationException.getResponse
public function getResponse($route, $parameters, $config = []) { // Copy standard response. $response = self::$response; // Fill the response. array_set($response, 'is_error', true); array_set($response, 'message', $this->getMessage()); array_set($response, 'fields',...
php
public function getResponse($route, $parameters, $config = []) { // Copy standard response. $response = self::$response; // Fill the response. array_set($response, 'is_error', true); array_set($response, 'message', $this->getMessage()); array_set($response, 'fields',...
[ "public", "function", "getResponse", "(", "$", "route", ",", "$", "parameters", ",", "$", "config", "=", "[", "]", ")", "{", "// Copy standard response.", "$", "response", "=", "self", "::", "$", "response", ";", "// Fill the response.", "array_set", "(", "$...
Get a response to return. @return string|array
[ "Get", "a", "response", "to", "return", "." ]
ca0c51e9862aac43d19cf06fb8bb810d6bc7d41e
https://github.com/hnhdigital-os/laravel-model-schema/blob/ca0c51e9862aac43d19cf06fb8bb810d6bc7d41e/src/Exceptions/ValidationException.php#L56-L93
29,838
ventoviro/windwalker-core
src/Core/Application/WebApplication.php
WebApplication.dispatch
public function dispatch(Request $request, Response $response, $finalHandler = null) { /** @var AbstractPackage $package */ $package = $this->getPackage(); if (!$package) { throw new RouteNotFoundException('Can not find package to execute.', 404); } return $pack...
php
public function dispatch(Request $request, Response $response, $finalHandler = null) { /** @var AbstractPackage $package */ $package = $this->getPackage(); if (!$package) { throw new RouteNotFoundException('Can not find package to execute.', 404); } return $pack...
[ "public", "function", "dispatch", "(", "Request", "$", "request", ",", "Response", "$", "response", ",", "$", "finalHandler", "=", "null", ")", "{", "/** @var AbstractPackage $package */", "$", "package", "=", "$", "this", "->", "getPackage", "(", ")", ";", ...
Method as the Psr7 WebHttpServer handler. @param Request $request The Psr7 ServerRequest to get request params. @param Response $response The Psr7 Response interface to prepare respond data. @param callable $finalHandler The next handler to support middleware pattern. @return Response The returned resp...
[ "Method", "as", "the", "Psr7", "WebHttpServer", "handler", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Application/WebApplication.php#L230-L240
29,839
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Parameter.php
Parameter.registerTransformation
static public function registerTransformation(iTransformation $transformation) { self::$transformations[$transformation->getName()] = get_class($transformation); print_r(self::$transformations); }
php
static public function registerTransformation(iTransformation $transformation) { self::$transformations[$transformation->getName()] = get_class($transformation); print_r(self::$transformations); }
[ "static", "public", "function", "registerTransformation", "(", "iTransformation", "$", "transformation", ")", "{", "self", "::", "$", "transformations", "[", "$", "transformation", "->", "getName", "(", ")", "]", "=", "get_class", "(", "$", "transformation", ")"...
Registers a new transformation @param iTransformation $transformation transformation to be registered
[ "Registers", "a", "new", "transformation" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Parameter.php#L68-L72
29,840
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Parameter.php
Parameter.value
static public function value(FedoraResource $res, string $valueProp, string $default, array $transformations): string { $value = $default; if ($valueProp !== '') { $matches = $res->getMetadata()->all($valueProp); if (count($matches) > 0) { ...
php
static public function value(FedoraResource $res, string $valueProp, string $default, array $transformations): string { $value = $default; if ($valueProp !== '') { $matches = $res->getMetadata()->all($valueProp); if (count($matches) > 0) { ...
[ "static", "public", "function", "value", "(", "FedoraResource", "$", "res", ",", "string", "$", "valueProp", ",", "string", "$", "default", ",", "array", "$", "transformations", ")", ":", "string", "{", "$", "value", "=", "$", "default", ";", "if", "(", ...
Returns parameter value for a given resource. @param FedoraResource $res repository resource to return the value for @param string $valueProp RDF property holding the parameter value. If empty, the $default value is used. @param string $default parameter default value @param string $transformations transformations to b...
[ "Returns", "parameter", "value", "for", "a", "given", "resource", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Parameter.php#L83-L115
29,841
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Parameter.php
Parameter.getName
public function getName(): string { $meta = $this->getMetadata(); return (string) $meta->getLiteral(RC::titleProp()); }
php
public function getName(): string { $meta = $this->getMetadata(); return (string) $meta->getLiteral(RC::titleProp()); }
[ "public", "function", "getName", "(", ")", ":", "string", "{", "$", "meta", "=", "$", "this", "->", "getMetadata", "(", ")", ";", "return", "(", "string", ")", "$", "meta", "->", "getLiteral", "(", "RC", "::", "titleProp", "(", ")", ")", ";", "}" ]
Returns parameter name @return string
[ "Returns", "parameter", "name" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Parameter.php#L136-L139
29,842
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/dissemination/Parameter.php
Parameter.getValue
public function getValue(FedoraResource $res, array $transformations = []): string { $overwrite = filter_input(INPUT_GET, $this->getName()); if ($overwrite !== null) { $valueProp = ''; $default = $overwrite; } else { $meta = $this->getMetadata(); ...
php
public function getValue(FedoraResource $res, array $transformations = []): string { $overwrite = filter_input(INPUT_GET, $this->getName()); if ($overwrite !== null) { $valueProp = ''; $default = $overwrite; } else { $meta = $this->getMetadata(); ...
[ "public", "function", "getValue", "(", "FedoraResource", "$", "res", ",", "array", "$", "transformations", "=", "[", "]", ")", ":", "string", "{", "$", "overwrite", "=", "filter_input", "(", "INPUT_GET", ",", "$", "this", "->", "getName", "(", ")", ")", ...
Return parameter value for a given repository resource @param FedoraResource $res repository resource to get the value for @param string $transformations transformations to be applied to the value @return string @see transform()
[ "Return", "parameter", "value", "for", "a", "given", "repository", "resource" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/dissemination/Parameter.php#L148-L165
29,843
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/Redmine.php
Redmine.redmineFetchLoop
static protected function redmineFetchLoop(Fedora $fedora, bool $progressBar, string $endpoint, string $param): array { if ($progressBar) { $pb = new ProgressBar(null, 10); } $class = get_...
php
static protected function redmineFetchLoop(Fedora $fedora, bool $progressBar, string $endpoint, string $param): array { if ($progressBar) { $pb = new ProgressBar(null, 10); } $class = get_...
[ "static", "protected", "function", "redmineFetchLoop", "(", "Fedora", "$", "fedora", ",", "bool", "$", "progressBar", ",", "string", "$", "endpoint", ",", "string", "$", "param", ")", ":", "array", "{", "if", "(", "$", "progressBar", ")", "{", "$", "pb",...
Fetches all objects from a given Redmine API endpoint. Redmine limits number of results returned by one API call to 100 therefore it may be needed to call the API many times. @param Fedora $fedora @param bool $progressBar @param string $endpoint @param string $param @return array
[ "Fetches", "all", "objects", "from", "a", "given", "Redmine", "API", "endpoint", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/Redmine.php#L113-L142
29,844
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/Redmine.php
Redmine.fetchData
static protected function fetchData(string $url): array { $url .= '.json?key=' . urlencode(RC::get('redmineApiKey')); $data = file_get_contents($url); if ($data) { $data = (array) json_decode($data); $data = array_pop($data); return (array) $data; } ...
php
static protected function fetchData(string $url): array { $url .= '.json?key=' . urlencode(RC::get('redmineApiKey')); $data = file_get_contents($url); if ($data) { $data = (array) json_decode($data); $data = array_pop($data); return (array) $data; } ...
[ "static", "protected", "function", "fetchData", "(", "string", "$", "url", ")", ":", "array", "{", "$", "url", ".=", "'.json?key='", ".", "urlencode", "(", "RC", "::", "get", "(", "'redmineApiKey'", ")", ")", ";", "$", "data", "=", "file_get_contents", "...
Fetches given Redmine entity description from the Redmine API URI. @param string $url @return array @throws RuntimeException
[ "Fetches", "given", "Redmine", "entity", "description", "from", "the", "Redmine", "API", "URI", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/Redmine.php#L150-L159
29,845
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/Redmine.php
Redmine.getMetadata
public function getMetadata(): Resource { $graph = new Graph(); $res = $graph->resource('.'); $res->addResource(RC::idProp(), $this->getId()); $res->addResource(self::$seeAlsoProp, $this->getId()); $classes = RC::get('redmineClasses'); $res->addResource('rdf:type', $c...
php
public function getMetadata(): Resource { $graph = new Graph(); $res = $graph->resource('.'); $res->addResource(RC::idProp(), $this->getId()); $res->addResource(self::$seeAlsoProp, $this->getId()); $classes = RC::get('redmineClasses'); $res->addResource('rdf:type', $c...
[ "public", "function", "getMetadata", "(", ")", ":", "Resource", "{", "$", "graph", "=", "new", "Graph", "(", ")", ";", "$", "res", "=", "$", "graph", "->", "resource", "(", "'.'", ")", ";", "$", "res", "->", "addResource", "(", "RC", "::", "idProp"...
Maps Redmine's object properties to and RDF graph. If resource already exists mapping must preserve already existing properties (especialy fedoraId) and also take care about deleting ones being "updated". That is because in RDF there is nothing like updating a triple. Triples can be only deleted or added. "Updating a ...
[ "Maps", "Redmine", "s", "object", "properties", "to", "and", "RDF", "graph", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/Redmine.php#L207-L246
29,846
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/redmine/Redmine.php
Redmine.addValue
private function addValue(Resource $res, stdClass $prop, string $value) { if (!$value) { return; } $value = str_replace('\\', '/', $value); // ugly workaround for windows-like paths; should be applied only to location_path property if ($prop->template !== '') { $...
php
private function addValue(Resource $res, stdClass $prop, string $value) { if (!$value) { return; } $value = str_replace('\\', '/', $value); // ugly workaround for windows-like paths; should be applied only to location_path property if ($prop->template !== '') { $...
[ "private", "function", "addValue", "(", "Resource", "$", "res", ",", "stdClass", "$", "prop", ",", "string", "$", "value", ")", "{", "if", "(", "!", "$", "value", ")", "{", "return", ";", "}", "$", "value", "=", "str_replace", "(", "'\\\\'", ",", "...
Adds RDF property to the metadata according to mapping rules. @param EasyRdf\Resource $res metadata @param stdClass $prop property mapping object @param string $value Redmine property value @throws RuntimeException
[ "Adds", "RDF", "property", "to", "the", "metadata", "according", "to", "mapping", "rules", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/redmine/Redmine.php#L256-L281
29,847
polyfony-inc/polyfony
Private/Storage/Defaults/Models/Accounts.php
Accounts.withErrors
public static function withErrors() :array { return self::_select() ->whereNotEmpty('last_failure_date') ->whereHigherThan('last_failure_date', time() - self::RECENT_FAILURE ) ->limitTo(0, 10) ->orderBy(['last_failure_date'=>'DESC']) ->execute(); }
php
public static function withErrors() :array { return self::_select() ->whereNotEmpty('last_failure_date') ->whereHigherThan('last_failure_date', time() - self::RECENT_FAILURE ) ->limitTo(0, 10) ->orderBy(['last_failure_date'=>'DESC']) ->execute(); }
[ "public", "static", "function", "withErrors", "(", ")", ":", "array", "{", "return", "self", "::", "_select", "(", ")", "->", "whereNotEmpty", "(", "'last_failure_date'", ")", "->", "whereHigherThan", "(", "'last_failure_date'", ",", "time", "(", ")", "-", "...
accounts that have had issues login in recently
[ "accounts", "that", "have", "had", "issues", "login", "in", "recently" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Storage/Defaults/Models/Accounts.php#L83-L92
29,848
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/file/File.php
File.detectPathEncoding
static private function detectPathEncoding() { if (self::$pathEncoding) { return; } foreach (explode(';', setlocale(LC_ALL, 0)) as $i) { $i = explode('=', $i); if ($i[0] === 'LC_CTYPE') { $tmp = preg_replace('|^.*[.]|', '', $i[1]); ...
php
static private function detectPathEncoding() { if (self::$pathEncoding) { return; } foreach (explode(';', setlocale(LC_ALL, 0)) as $i) { $i = explode('=', $i); if ($i[0] === 'LC_CTYPE') { $tmp = preg_replace('|^.*[.]|', '', $i[1]); ...
[ "static", "private", "function", "detectPathEncoding", "(", ")", "{", "if", "(", "self", "::", "$", "pathEncoding", ")", "{", "return", ";", "}", "foreach", "(", "explode", "(", "';'", ",", "setlocale", "(", "LC_ALL", ",", "0", ")", ")", "as", "$", "...
Tries to detect path encoding used in the operating system by looking into locale settings. @throws RuntimeException
[ "Tries", "to", "detect", "path", "encoding", "used", "in", "the", "operating", "system", "by", "looking", "into", "locale", "settings", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/file/File.php#L60-L79
29,849
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/file/File.php
File.getMetadata
public function getMetadata(): Resource { $graph = new Graph(); $meta = $graph->resource('.'); $meta->addResource(RC::idProp(), $this->getId()); if ($this->class != '') { $meta->addResource('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $this->class); } ...
php
public function getMetadata(): Resource { $graph = new Graph(); $meta = $graph->resource('.'); $meta->addResource(RC::idProp(), $this->getId()); if ($this->class != '') { $meta->addResource('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $this->class); } ...
[ "public", "function", "getMetadata", "(", ")", ":", "Resource", "{", "$", "graph", "=", "new", "Graph", "(", ")", ";", "$", "meta", "=", "$", "graph", "->", "resource", "(", "'.'", ")", ";", "$", "meta", "->", "addResource", "(", "RC", "::", "idPro...
Creates RDF metadata for a file. Can use metadata lookup mechanism - see the setMetaLookup() method. @return Resource @see setMetaLookup()
[ "Creates", "RDF", "metadata", "for", "a", "file", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/file/File.php#L171-L203
29,850
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/file/File.php
File.getMime
public function getMime() { switch(strtolower(pathinfo($this->path, PATHINFO_EXTENSION))) { case 'json': $mime = 'application/json'; break; case 'geojson': $mime = 'application/vnd.geo+json'; break; default: ...
php
public function getMime() { switch(strtolower(pathinfo($this->path, PATHINFO_EXTENSION))) { case 'json': $mime = 'application/json'; break; case 'geojson': $mime = 'application/vnd.geo+json'; break; default: ...
[ "public", "function", "getMime", "(", ")", "{", "switch", "(", "strtolower", "(", "pathinfo", "(", "$", "this", "->", "path", ",", "PATHINFO_EXTENSION", ")", ")", ")", "{", "case", "'json'", ":", "$", "mime", "=", "'application/json'", ";", "break", ";",...
Returns file's mime type @return string
[ "Returns", "file", "s", "mime", "type" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/file/File.php#L225-L237
29,851
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/file/File.php
File.mergeMetadata
protected function mergeMetadata(Resource $current, Resource $new): Resource { // title handling logic: // if title is not provided by an external metadata (also when there is // no external metadata) and current $oldTitle = $current->getLiteral(RC::titleProp()); $extTitle = null...
php
protected function mergeMetadata(Resource $current, Resource $new): Resource { // title handling logic: // if title is not provided by an external metadata (also when there is // no external metadata) and current $oldTitle = $current->getLiteral(RC::titleProp()); $extTitle = null...
[ "protected", "function", "mergeMetadata", "(", "Resource", "$", "current", ",", "Resource", "$", "new", ")", ":", "Resource", "{", "// title handling logic:", "// if title is not provided by an external metadata (also when there is", "// no external metadata) and current", "$", ...
Merges metadata coming from the Fedora and generated by the class. Preserves the resource title if it already exists. @param Resource $current current Fedora resource metadata @param Resource $new metadata generated by the class @return Resource final metadata
[ "Merges", "metadata", "coming", "from", "the", "Fedora", "and", "generated", "by", "the", "class", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/file/File.php#L263-L282
29,852
polyfony-inc/polyfony
Private/Storage/Defaults/Bundles/Shared/Controllers/Exception.php
ExceptionController.exceptionAction
public function exceptionAction() { // get the exception $this->Exception = Store\Request::get('exception'); // if the exception is not a 404 or a 403 (the most common and non important) if( $this->Exception->getCode() < 401 || $this->Exception->getCode() > 404 ) { // log the exception Logger:...
php
public function exceptionAction() { // get the exception $this->Exception = Store\Request::get('exception'); // if the exception is not a 404 or a 403 (the most common and non important) if( $this->Exception->getCode() < 401 || $this->Exception->getCode() > 404 ) { // log the exception Logger:...
[ "public", "function", "exceptionAction", "(", ")", "{", "// get the exception", "$", "this", "->", "Exception", "=", "Store", "\\", "Request", "::", "get", "(", "'exception'", ")", ";", "// if the exception is not a 404 or a 403 (the most common and non important)", "if",...
this exception action is quite generic and can be kept for production
[ "this", "exception", "action", "is", "quite", "generic", "and", "can", "be", "kept", "for", "production" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Storage/Defaults/Bundles/Shared/Controllers/Exception.php#L13-L96
29,853
ventoviro/windwalker-core
src/Core/Logger/Monolog/MessageHandler.php
MessageHandler.handle
public function handle(array $record) { if (!$this->isHandling($record)) { return false; } $type = $this->types[strtolower($record['level_name'])]; $this->app->addMessage($record['message'], $type); return false === $this->bubble; }
php
public function handle(array $record) { if (!$this->isHandling($record)) { return false; } $type = $this->types[strtolower($record['level_name'])]; $this->app->addMessage($record['message'], $type); return false === $this->bubble; }
[ "public", "function", "handle", "(", "array", "$", "record", ")", "{", "if", "(", "!", "$", "this", "->", "isHandling", "(", "$", "record", ")", ")", "{", "return", "false", ";", "}", "$", "type", "=", "$", "this", "->", "types", "[", "strtolower",...
Handles a record. All records may be passed to this method, and the handler should discard those that it does not want to handle. The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further ...
[ "Handles", "a", "record", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Logger/Monolog/MessageHandler.php#L77-L88
29,854
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.setUrlParameter
public static function setUrlParameter(string $key, $value=null) :void { // set the value self::$_get[$key] = $value; }
php
public static function setUrlParameter(string $key, $value=null) :void { // set the value self::$_get[$key] = $value; }
[ "public", "static", "function", "setUrlParameter", "(", "string", "$", "key", ",", "$", "value", "=", "null", ")", ":", "void", "{", "// set the value", "self", "::", "$", "_get", "[", "$", "key", "]", "=", "$", "value", ";", "}" ]
rarely used but can allow to artificially set a get parameter
[ "rarely", "used", "but", "can", "allow", "to", "artificially", "set", "a", "get", "parameter" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L122-L127
29,855
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.header
public static function header(string $variable, $default=null) { return isset(self::$_headers[$variable]) ? self::$_headers[$variable] : $default; }
php
public static function header(string $variable, $default=null) { return isset(self::$_headers[$variable]) ? self::$_headers[$variable] : $default; }
[ "public", "static", "function", "header", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_headers", "[", "$", "variable", "]", ")", "?", "self", "::", "$", "_headers", "[", "$",...
Get a single Header variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "Header", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L146-L150
29,856
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.get
public static function get(string $variable, $default = null) { return isset(self::$_get[$variable]) ? urldecode(self::$_get[$variable]) : $default; }
php
public static function get(string $variable, $default = null) { return isset(self::$_get[$variable]) ? urldecode(self::$_get[$variable]) : $default; }
[ "public", "static", "function", "get", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_get", "[", "$", "variable", "]", ")", "?", "urldecode", "(", "self", "::", "$", "_get", ...
Get a single GET variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "GET", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L162-L166
29,857
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.post
public static function post(string $variable, $default = null) { return isset(self::$_post[$variable]) ? self::$_post[$variable] : $default; }
php
public static function post(string $variable, $default = null) { return isset(self::$_post[$variable]) ? self::$_post[$variable] : $default; }
[ "public", "static", "function", "post", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_post", "[", "$", "variable", "]", ")", "?", "self", "::", "$", "_post", "[", "$", "vari...
Get a single POST variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "POST", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L177-L181
29,858
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.files
public static function files(string $variable, $default = null) { return isset(self::$_files[$variable]) ? self::$_files[$variable] : $default; }
php
public static function files(string $variable, $default = null) { return isset(self::$_files[$variable]) ? self::$_files[$variable] : $default; }
[ "public", "static", "function", "files", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_files", "[", "$", "variable", "]", ")", "?", "self", "::", "$", "_files", "[", "$", "v...
Get a single FILES variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "FILES", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L192-L196
29,859
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.server
public static function server(string $variable, $default = null) { return isset(self::$_server[$variable]) ? self::$_server[$variable] : $default; }
php
public static function server(string $variable, $default = null) { return isset(self::$_server[$variable]) ? self::$_server[$variable] : $default; }
[ "public", "static", "function", "server", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_server", "[", "$", "variable", "]", ")", "?", "self", "::", "$", "_server", "[", "$", ...
Get a single SERVER variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "SERVER", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L207-L211
29,860
polyfony-inc/polyfony
Private/Polyfony/Request.php
Request.argv
public static function argv(string $variable, $default = null) { return isset(self::$_argv[$variable]) ? self::$_argv[$variable] : $default; }
php
public static function argv(string $variable, $default = null) { return isset(self::$_argv[$variable]) ? self::$_argv[$variable] : $default; }
[ "public", "static", "function", "argv", "(", "string", "$", "variable", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "self", "::", "$", "_argv", "[", "$", "variable", "]", ")", "?", "self", "::", "$", "_argv", "[", "$", "vari...
Get a single argv variable. @access public @param string $variable The variable we wish to return. @param mixed $default If the variable is not found, this is returned. @return mixed @static
[ "Get", "a", "single", "argv", "variable", "." ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Request.php#L223-L227
29,861
acdh-oeaw/repo-php-util
src/acdhOeaw/util/ResourceFactory.php
ResourceFactory.removeAcl
static public function removeAcl(Fedora $fedora, bool $verbose = true) { echo $verbose ? "removing ACL rules\n" : ''; $fedora->rollback(); $fedora->begin(); $resp = $fedora->getResourcesByProperty('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/ns/auth/acl#Authori...
php
static public function removeAcl(Fedora $fedora, bool $verbose = true) { echo $verbose ? "removing ACL rules\n" : ''; $fedora->rollback(); $fedora->begin(); $resp = $fedora->getResourcesByProperty('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://www.w3.org/ns/auth/acl#Authori...
[ "static", "public", "function", "removeAcl", "(", "Fedora", "$", "fedora", ",", "bool", "$", "verbose", "=", "true", ")", "{", "echo", "$", "verbose", "?", "\"removing ACL rules\\n\"", ":", "''", ";", "$", "fedora", "->", "rollback", "(", ")", ";", "$", ...
Removes all access control rules from the repository @param Fedora $fedora Fedora connection object @param bool $verbose should progess messages be displayed
[ "Removes", "all", "access", "control", "rules", "from", "the", "repository" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/ResourceFactory.php#L152-L192
29,862
acdh-oeaw/repo-php-util
src/acdhOeaw/schema/dissemination/Parameter.php
Parameter.getMetadata
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addResource(RC::relProp(), $this->service->getResource()->getId()); $meta->addResource(RC::idProp(), $this->getId()); $meta->addType(RC::get('fedoraServiceParamClass')); $titleProp = RC::get(...
php
public function getMetadata(): Resource { $meta = (new Graph())->resource('.'); $meta->addResource(RC::relProp(), $this->service->getResource()->getId()); $meta->addResource(RC::idProp(), $this->getId()); $meta->addType(RC::get('fedoraServiceParamClass')); $titleProp = RC::get(...
[ "public", "function", "getMetadata", "(", ")", ":", "Resource", "{", "$", "meta", "=", "(", "new", "Graph", "(", ")", ")", "->", "resource", "(", "'.'", ")", ";", "$", "meta", "->", "addResource", "(", "RC", "::", "relProp", "(", ")", ",", "$", "...
Returns metadata describing the dissemination service parameter @return Resource
[ "Returns", "metadata", "describing", "the", "dissemination", "service", "parameter" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/schema/dissemination/Parameter.php#L106-L123
29,863
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.setText
public function setText(string $text=null, bool $append=true) :self { // append by default or replace text $this->content = $append ? $this->content . Format::htmlSafe($text) : Format::htmlSafe($text); // return self return($this); }
php
public function setText(string $text=null, bool $append=true) :self { // append by default or replace text $this->content = $append ? $this->content . Format::htmlSafe($text) : Format::htmlSafe($text); // return self return($this); }
[ "public", "function", "setText", "(", "string", "$", "text", "=", "null", ",", "bool", "$", "append", "=", "true", ")", ":", "self", "{", "// append by default or replace text", "$", "this", "->", "content", "=", "$", "append", "?", "$", "this", "->", "c...
set the text in the tag
[ "set", "the", "text", "in", "the", "tag" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L26-L31
29,864
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.setHtml
public function setHtml(string $html=null, bool $append=true) :self { // append by default or replace html $this->content = $append ? $this->content . $html : $html; // return self return($this); }
php
public function setHtml(string $html=null, bool $append=true) :self { // append by default or replace html $this->content = $append ? $this->content . $html : $html; // return self return($this); }
[ "public", "function", "setHtml", "(", "string", "$", "html", "=", "null", ",", "bool", "$", "append", "=", "true", ")", ":", "self", "{", "// append by default or replace html", "$", "this", "->", "content", "=", "$", "append", "?", "$", "this", "->", "c...
set the html in the tag
[ "set", "the", "html", "in", "the", "tag" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L34-L39
29,865
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.setStyle
public function setStyle(array $css_properties=[]) :self { // init the style attribute is it didn't exist already isset($this->attributes['style']) ?: $this->attributes['style'] = ''; // for each of the css properties foreach($css_properties as $css_property => $css_value) { // add them to the already existi...
php
public function setStyle(array $css_properties=[]) :self { // init the style attribute is it didn't exist already isset($this->attributes['style']) ?: $this->attributes['style'] = ''; // for each of the css properties foreach($css_properties as $css_property => $css_value) { // add them to the already existi...
[ "public", "function", "setStyle", "(", "array", "$", "css_properties", "=", "[", "]", ")", ":", "self", "{", "// init the style attribute is it didn't exist already", "isset", "(", "$", "this", "->", "attributes", "[", "'style'", "]", ")", "?", ":", "$", "this...
set the style for the tag
[ "set", "the", "style", "for", "the", "tag" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L42-L52
29,866
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.setValue
public function setValue($value=null) :self { // append by default or replace html $this->attributes['value'] = Format::htmlSafe($value); // return self return($this); }
php
public function setValue($value=null) :self { // append by default or replace html $this->attributes['value'] = Format::htmlSafe($value); // return self return($this); }
[ "public", "function", "setValue", "(", "$", "value", "=", "null", ")", ":", "self", "{", "// append by default or replace html", "$", "this", "->", "attributes", "[", "'value'", "]", "=", "Format", "::", "htmlSafe", "(", "$", "value", ")", ";", "// return se...
set the value of a tag
[ "set", "the", "value", "of", "a", "tag" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L55-L60
29,867
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.set
public function set($attribute, $value=null) :self { // array is passed if(is_array($attribute)) { // for each associative value in the array foreach($attribute as $single_attribute => $single_value) { // recurse with a single pair or attribute/value $this->set($single_attribute, $single_value); } ...
php
public function set($attribute, $value=null) :self { // array is passed if(is_array($attribute)) { // for each associative value in the array foreach($attribute as $single_attribute => $single_value) { // recurse with a single pair or attribute/value $this->set($single_attribute, $single_value); } ...
[ "public", "function", "set", "(", "$", "attribute", ",", "$", "value", "=", "null", ")", ":", "self", "{", "// array is passed", "if", "(", "is_array", "(", "$", "attribute", ")", ")", "{", "// for each associative value in the array", "foreach", "(", "$", "...
set everything, mostly attribute but also content
[ "set", "everything", "mostly", "attribute", "but", "also", "content" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L63-L101
29,868
polyfony-inc/polyfony
Private/Polyfony/Element.php
Element.adopt
public function adopt($child, $before=false) { // adopt, or adopt before $this->content = $before ? $child . $this->content : $this->content . $child; // return self return($this); }
php
public function adopt($child, $before=false) { // adopt, or adopt before $this->content = $before ? $child . $this->content : $this->content . $child; // return self return($this); }
[ "public", "function", "adopt", "(", "$", "child", ",", "$", "before", "=", "false", ")", "{", "// adopt, or adopt before", "$", "this", "->", "content", "=", "$", "before", "?", "$", "child", ".", "$", "this", "->", "content", ":", "$", "this", "->", ...
adopt an element of the same kind
[ "adopt", "an", "element", "of", "the", "same", "kind" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Element.php#L104-L109
29,869
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.hmvc
public function hmvc($task, $input = null, $package = null) { // If task is controller object, just execute it. if ($task instanceof AbstractController) { if (is_array($input)) { $input = new Input($input); } // Let's push some important data into...
php
public function hmvc($task, $input = null, $package = null) { // If task is controller object, just execute it. if ($task instanceof AbstractController) { if (is_array($input)) { $input = new Input($input); } // Let's push some important data into...
[ "public", "function", "hmvc", "(", "$", "task", ",", "$", "input", "=", "null", ",", "$", "package", "=", "null", ")", "{", "// If task is controller object, just execute it.", "if", "(", "$", "task", "instanceof", "AbstractController", ")", "{", "if", "(", ...
Run HMVC to fetch content from other controller. @param string|AbstractController $task The task to exeiocute, must be controller object or string. The string format is `Name\ActionController` example: `Page\GetController` @param Input|array $input The input for this task, can be array or Input obje...
[ "Run", "HMVC", "to", "fetch", "content", "from", "other", "controller", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L176-L217
29,870
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.execute
public function execute() { try { // @ prepare hook $this->prepareExecute(); // @ before event $this->triggerEvent('onControllerBeforeExecute', [ 'controller' => $this ]); // Prepare the last middleware, the last middl...
php
public function execute() { try { // @ prepare hook $this->prepareExecute(); // @ before event $this->triggerEvent('onControllerBeforeExecute', [ 'controller' => $this ]); // Prepare the last middleware, the last middl...
[ "public", "function", "execute", "(", ")", "{", "try", "{", "// @ prepare hook", "$", "this", "->", "prepareExecute", "(", ")", ";", "// @ before event", "$", "this", "->", "triggerEvent", "(", "'onControllerBeforeExecute'", ",", "[", "'controller'", "=>", "$", ...
Execute the controller. @return mixed Return executed result. @throws \Exception @throws \Throwable
[ "Execute", "the", "controller", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L255-L314
29,871
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.delegate
protected function delegate($task, ...$args) { if (method_exists($this, $task)) { return $this->container->call([$this, $task], $args, $this); } if (is_callable($task)) { return $this->container->call($task, $args, $this); } throw new \LogicException...
php
protected function delegate($task, ...$args) { if (method_exists($this, $task)) { return $this->container->call([$this, $task], $args, $this); } if (is_callable($task)) { return $this->container->call($task, $args, $this); } throw new \LogicException...
[ "protected", "function", "delegate", "(", "$", "task", ",", "...", "$", "args", ")", "{", "if", "(", "method_exists", "(", "$", "this", ",", "$", "task", ")", ")", "{", "return", "$", "this", "->", "container", "->", "call", "(", "[", "$", "this", ...
Method to easily distribute task to other methods that we can process different tasks. Example in doExecute(): ``` return $this->delegate($this->input->get('task'), `arg1`, `arg2`); // OR return $this->delegate([$object, 'method'], `arg1`, `arg2`); ``` @param string $task The task name. @param array $args The ...
[ "Method", "to", "easily", "distribute", "task", "to", "other", "methods", "that", "we", "can", "process", "different", "tasks", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L335-L346
29,872
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.renderView
public function renderView($view, $layout = 'default', $engine = 'php', array $data = []) { $viewObject = $view; if (\is_string($view)) { $viewObject = class_exists($view) ? $this->container->createSharedObject($view) : $this->getView($view, 'html', $engi...
php
public function renderView($view, $layout = 'default', $engine = 'php', array $data = []) { $viewObject = $view; if (\is_string($view)) { $viewObject = class_exists($view) ? $this->container->createSharedObject($view) : $this->getView($view, 'html', $engi...
[ "public", "function", "renderView", "(", "$", "view", ",", "$", "layout", "=", "'default'", ",", "$", "engine", "=", "'php'", ",", "array", "$", "data", "=", "[", "]", ")", "{", "$", "viewObject", "=", "$", "view", ";", "if", "(", "\\", "is_string"...
Method to easily render view. @param LayoutRenderableInterface|string $view The view name or object. @param string $layout The layout to render. @param string $engine The engine of template. @param array $data The data to set in view. ...
[ "Method", "to", "easily", "render", "view", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L360-L382
29,873
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.getView
public function getView($name = null, $format = 'html', $engine = null, $forceNew = false) { $name = $name ?: $this->getName(); $format = $format ?: 'html'; $key = ViewResolver::getDIKey($name . '.' . strtolower($format)); // Let's prepare controller getter. if (!$this->co...
php
public function getView($name = null, $format = 'html', $engine = null, $forceNew = false) { $name = $name ?: $this->getName(); $format = $format ?: 'html'; $key = ViewResolver::getDIKey($name . '.' . strtolower($format)); // Let's prepare controller getter. if (!$this->co...
[ "public", "function", "getView", "(", "$", "name", "=", "null", ",", "$", "format", "=", "'html'", ",", "$", "engine", "=", "null", ",", "$", "forceNew", "=", "false", ")", "{", "$", "name", "=", "$", "name", "?", ":", "$", "this", "->", "getName...
Get view object. @param string $name The view name. @param string $format The view foramt. @param string $engine The renderer template engine. @param bool $forceNew The Force create new instance. @return AbstractView|HtmlView @throws \Exception
[ "Get", "view", "object", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L422-L480
29,874
ventoviro/windwalker-core
src/Core/Controller/AbstractController.php
AbstractController.isHmvc
public function isHmvc($boolean = null) { if ($boolean === null) { return $this->hmvc; } $this->hmvc = (bool) $boolean; return $this; }
php
public function isHmvc($boolean = null) { if ($boolean === null) { return $this->hmvc; } $this->hmvc = (bool) $boolean; return $this; }
[ "public", "function", "isHmvc", "(", "$", "boolean", "=", "null", ")", "{", "if", "(", "$", "boolean", "===", "null", ")", "{", "return", "$", "this", "->", "hmvc", ";", "}", "$", "this", "->", "hmvc", "=", "(", "bool", ")", "$", "boolean", ";", ...
Check this controller is in HMVC that we can close some behaviors. @param boolean $boolean @return static|boolean
[ "Check", "this", "controller", "is", "in", "HMVC", "that", "we", "can", "close", "some", "behaviors", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Controller/AbstractController.php#L1023-L1032
29,875
ventoviro/windwalker-core
src/Core/Migration/Command/MigrationCommand.php
MigrationCommand.init
public function init() { $this->addCommand(Migration\CreateCommand::class); $this->addCommand(Migration\StatusCommand::class); $this->addCommand(Migration\MigrateCommand::class); $this->addCommand(Migration\ResetCommand::class); $this->addCommand(Migration\DropAllCommand::cla...
php
public function init() { $this->addCommand(Migration\CreateCommand::class); $this->addCommand(Migration\StatusCommand::class); $this->addCommand(Migration\MigrateCommand::class); $this->addCommand(Migration\ResetCommand::class); $this->addCommand(Migration\DropAllCommand::cla...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "addCommand", "(", "Migration", "\\", "CreateCommand", "::", "class", ")", ";", "$", "this", "->", "addCommand", "(", "Migration", "\\", "StatusCommand", "::", "class", ")", ";", "$", "this"...
Configure command information. @return void
[ "Configure", "command", "information", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Migration/Command/MigrationCommand.php#L59-L74
29,876
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.setParent
public function setParent(FedoraResource $resource): Indexer { $this->parent = $resource; $this->fedora = $this->parent->getFedora(); $metadata = $this->parent->getMetadata(); $locations = $metadata->allLiterals(RC::locProp()); foreach ($locations as $i) { $loc...
php
public function setParent(FedoraResource $resource): Indexer { $this->parent = $resource; $this->fedora = $this->parent->getFedora(); $metadata = $this->parent->getMetadata(); $locations = $metadata->allLiterals(RC::locProp()); foreach ($locations as $i) { $loc...
[ "public", "function", "setParent", "(", "FedoraResource", "$", "resource", ")", ":", "Indexer", "{", "$", "this", "->", "parent", "=", "$", "resource", ";", "$", "this", "->", "fedora", "=", "$", "this", "->", "parent", "->", "getFedora", "(", ")", ";"...
Sets the parent resource for the indexed files @param FedoraResource $resource
[ "Sets", "the", "parent", "resource", "for", "the", "indexed", "files" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L233-L245
29,877
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.setSkip
public function setSkip(int $skipMode): Indexer { if (!in_array($skipMode, [self::SKIP_NONE, self::SKIP_NOT_EXIST, self::SKIP_EXIST, self::SKIP_BINARY_EXIST])) { throw new BadMethodCallException('Wrong skip mode'); } $this->skipMode = $skipMode; return $this; }
php
public function setSkip(int $skipMode): Indexer { if (!in_array($skipMode, [self::SKIP_NONE, self::SKIP_NOT_EXIST, self::SKIP_EXIST, self::SKIP_BINARY_EXIST])) { throw new BadMethodCallException('Wrong skip mode'); } $this->skipMode = $skipMode; return $this; }
[ "public", "function", "setSkip", "(", "int", "$", "skipMode", ")", ":", "Indexer", "{", "if", "(", "!", "in_array", "(", "$", "skipMode", ",", "[", "self", "::", "SKIP_NONE", ",", "self", "::", "SKIP_NOT_EXIST", ",", "self", "::", "SKIP_EXIST", ",", "s...
Allows to turn on skipping of already existing resource or resources which don't exist in the Fedora already. @param int $skipMode mode either Indexer::SKIP_NONE (default), Indexer::SKIP_NOT_EXIST, Indexer::SKIP_EXIST or Indexer::SKIP_BINARY_EXIST @return \acdhOeaw\util\Indexer
[ "Allows", "to", "turn", "on", "skipping", "of", "already", "existing", "resource", "or", "resources", "which", "don", "t", "exist", "in", "the", "Fedora", "already", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L283-L289
29,878
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.setFilter
public function setFilter(string $filter, int $type = self::MATCH): Indexer { switch ($type) { case self::MATCH: $this->filter = $filter; break; case self::SKIP: $this->filterNot = $filter; break; default: ...
php
public function setFilter(string $filter, int $type = self::MATCH): Indexer { switch ($type) { case self::MATCH: $this->filter = $filter; break; case self::SKIP: $this->filterNot = $filter; break; default: ...
[ "public", "function", "setFilter", "(", "string", "$", "filter", ",", "int", "$", "type", "=", "self", "::", "MATCH", ")", ":", "Indexer", "{", "switch", "(", "$", "type", ")", "{", "case", "self", "::", "MATCH", ":", "$", "this", "->", "filter", "...
Sets file name filter for child resources. You can choose if file names must match or must not match (skip) the filter using the $type parameter. You can set both match and skip filters by calling setFilter() two times (once with `$type = Indexer::MATCH` and second time with `$type = Indexer::SKIP`). Filter is applie...
[ "Sets", "file", "name", "filter", "for", "child", "resources", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L332-L344
29,879
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.setMetaLookup
public function setMetaLookup(MetaLookupInterface $metaLookup, bool $require = false): Indexer { $this->metaLookup = $metaLookup; $this->metaLookupRequire = $require; return $this; }
php
public function setMetaLookup(MetaLookupInterface $metaLookup, bool $require = false): Indexer { $this->metaLookup = $metaLookup; $this->metaLookupRequire = $require; return $this; }
[ "public", "function", "setMetaLookup", "(", "MetaLookupInterface", "$", "metaLookup", ",", "bool", "$", "require", "=", "false", ")", ":", "Indexer", "{", "$", "this", "->", "metaLookup", "=", "$", "metaLookup", ";", "$", "this", "->", "metaLookupRequire", "...
Sets a class providing metadata for indexed files. @param MetaLookupInterface $metaLookup @param bool $require should files lacking external metadata be skipped @return \acdhOeaw\util\Indexer
[ "Sets", "a", "class", "providing", "metadata", "for", "indexed", "files", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L425-L430
29,880
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.isSkippedExisting
private function isSkippedExisting(File $file): bool { if (!in_array($this->skipMode, [self::SKIP_EXIST, self::SKIP_BINARY_EXIST])) { return false; } try { $res = $file->getResource(false, false); return $res->isBinary() || $this->skipMode === self::SKIP_EXIST...
php
private function isSkippedExisting(File $file): bool { if (!in_array($this->skipMode, [self::SKIP_EXIST, self::SKIP_BINARY_EXIST])) { return false; } try { $res = $file->getResource(false, false); return $res->isBinary() || $this->skipMode === self::SKIP_EXIST...
[ "private", "function", "isSkippedExisting", "(", "File", "$", "file", ")", ":", "bool", "{", "if", "(", "!", "in_array", "(", "$", "this", "->", "skipMode", ",", "[", "self", "::", "SKIP_EXIST", ",", "self", "::", "SKIP_BINARY_EXIST", "]", ")", ")", "{...
Checks if a given file should be skipped because it already exists in the repository while the Indexer skip mode is set to SKIP_EXIST or SKIP_BINARY_EXIST. @param File $file file to be checked @return bool @throws MetaLookupException
[ "Checks", "if", "a", "given", "file", "should", "be", "skipped", "because", "it", "already", "exists", "in", "the", "repository", "while", "the", "Indexer", "skip", "mode", "is", "set", "to", "SKIP_EXIST", "or", "SKIP_BINARY_EXIST", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L555-L571
29,881
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.isSkipped
private function isSkipped(DirectoryIterator $i): bool { $isEmptyDir = true; if ($i->isDir()) { foreach (new DirectoryIterator($i->getPathname()) as $j) { if (!$j->isDot()) { $isEmptyDir = false; break; } } ...
php
private function isSkipped(DirectoryIterator $i): bool { $isEmptyDir = true; if ($i->isDir()) { foreach (new DirectoryIterator($i->getPathname()) as $j) { if (!$j->isDot()) { $isEmptyDir = false; break; } } ...
[ "private", "function", "isSkipped", "(", "DirectoryIterator", "$", "i", ")", ":", "bool", "{", "$", "isEmptyDir", "=", "true", ";", "if", "(", "$", "i", "->", "isDir", "(", ")", ")", "{", "foreach", "(", "new", "DirectoryIterator", "(", "$", "i", "->...
Checks if a given file system node should be skipped during import. @param DirectoryIterator $i file system node @return bool
[ "Checks", "if", "a", "given", "file", "system", "node", "should", "be", "skipped", "during", "import", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L579-L594
29,882
acdh-oeaw/repo-php-util
src/acdhOeaw/util/Indexer.php
Indexer.handleAutoCommit
private function handleAutoCommit(): bool { $diff = count($this->indexedRes) - count($this->commitedRes); if ($diff >= $this->autoCommit && $this->autoCommit > 0) { echo self::$debug ? " + autocommit" : ''; $this->fedora->commit(); $this->commitedRes = $this->indexedR...
php
private function handleAutoCommit(): bool { $diff = count($this->indexedRes) - count($this->commitedRes); if ($diff >= $this->autoCommit && $this->autoCommit > 0) { echo self::$debug ? " + autocommit" : ''; $this->fedora->commit(); $this->commitedRes = $this->indexedR...
[ "private", "function", "handleAutoCommit", "(", ")", ":", "bool", "{", "$", "diff", "=", "count", "(", "$", "this", "->", "indexedRes", ")", "-", "count", "(", "$", "this", "->", "commitedRes", ")", ";", "if", "(", "$", "diff", ">=", "$", "this", "...
Performs autocommit if needed @return bool if autocommit was performed
[ "Performs", "autocommit", "if", "needed" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/util/Indexer.php#L600-L610
29,883
ventoviro/windwalker-core
src/Core/Package/AbstractPackage.php
AbstractPackage.registerCommands
public function registerCommands(Console $console) { $commands = (array) $this->get('console.commands'); foreach ($commands as $class) { if (class_exists($class) && is_subclass_of($class, Command::class)) { $console->addCommand($this->container->createObject($class)); ...
php
public function registerCommands(Console $console) { $commands = (array) $this->get('console.commands'); foreach ($commands as $class) { if (class_exists($class) && is_subclass_of($class, Command::class)) { $console->addCommand($this->container->createObject($class)); ...
[ "public", "function", "registerCommands", "(", "Console", "$", "console", ")", "{", "$", "commands", "=", "(", "array", ")", "$", "this", "->", "get", "(", "'console.commands'", ")", ";", "foreach", "(", "$", "commands", "as", "$", "class", ")", "{", "...
Register commands to console. @param Console $console Windwalker console object. @return void
[ "Register", "commands", "to", "console", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Package/AbstractPackage.php#L429-L438
29,884
ventoviro/windwalker-core
src/Core/Package/AbstractPackage.php
AbstractPackage.getConfig
public function getConfig() { if (!$this->config) { $this->config = new Structure(); $this->loadConfig($this->config); } return $this->config; }
php
public function getConfig() { if (!$this->config) { $this->config = new Structure(); $this->loadConfig($this->config); } return $this->config; }
[ "public", "function", "getConfig", "(", ")", "{", "if", "(", "!", "$", "this", "->", "config", ")", "{", "$", "this", "->", "config", "=", "new", "Structure", "(", ")", ";", "$", "this", "->", "loadConfig", "(", "$", "this", "->", "config", ")", ...
Method to get property Config @return Structure @since 2.1 @throws \ReflectionException
[ "Method", "to", "get", "property", "Config" ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Core/Package/AbstractPackage.php#L897-L906
29,885
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/GuzzleLogger.php
GuzzleLogger.onSuccess
protected function onSuccess(RequestInterface $request) { return function ($response) use ($request) { $this->log($request, $response); return $response; }; }
php
protected function onSuccess(RequestInterface $request) { return function ($response) use ($request) { $this->log($request, $response); return $response; }; }
[ "protected", "function", "onSuccess", "(", "RequestInterface", "$", "request", ")", "{", "return", "function", "(", "$", "response", ")", "use", "(", "$", "request", ")", "{", "$", "this", "->", "log", "(", "$", "request", ",", "$", "response", ")", ";...
Returns a function which is handled when a request was successful. @param RequestInterface $request @return Closure
[ "Returns", "a", "function", "which", "is", "handled", "when", "a", "request", "was", "successful", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/GuzzleLogger.php#L90-L96
29,886
secucard/secucard-connect-php-sdk
src/SecucardConnect/Util/GuzzleLogger.php
GuzzleLogger.onFailure
protected function onFailure(RequestInterface $request) { return function ($reason) use ($request) { // Only log a rejected requests if it hasn't already been logged $this->log($request, null, $reason); return Promise\rejection_for($reason); }; }
php
protected function onFailure(RequestInterface $request) { return function ($reason) use ($request) { // Only log a rejected requests if it hasn't already been logged $this->log($request, null, $reason); return Promise\rejection_for($reason); }; }
[ "protected", "function", "onFailure", "(", "RequestInterface", "$", "request", ")", "{", "return", "function", "(", "$", "reason", ")", "use", "(", "$", "request", ")", "{", "// Only log a rejected requests if it hasn't already been logged", "$", "this", "->", "log"...
Returns a function which is handled when a request was rejected. @param RequestInterface $request @return Closure
[ "Returns", "a", "function", "which", "is", "handled", "when", "a", "request", "was", "rejected", "." ]
d990686095e4e02d0924fc12b9bf60140fe8efab
https://github.com/secucard/secucard-connect-php-sdk/blob/d990686095e4e02d0924fc12b9bf60140fe8efab/src/SecucardConnect/Util/GuzzleLogger.php#L105-L114
29,887
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.query
public function query( string $query, $values=null, $table=null ) { // set the main action $this->action('QUERY'); // set the table $this->Table = $table; // set the query $this->Query = $query; // set the array of values $this->Values = $values; // detetect the action $action = substr($que...
php
public function query( string $query, $values=null, $table=null ) { // set the main action $this->action('QUERY'); // set the table $this->Table = $table; // set the query $this->Query = $query; // set the array of values $this->Values = $values; // detetect the action $action = substr($que...
[ "public", "function", "query", "(", "string", "$", "query", ",", "$", "values", "=", "null", ",", "$", "table", "=", "null", ")", "{", "// set the main action", "$", "this", "->", "action", "(", "'QUERY'", ")", ";", "// set the table", "$", "this", "->",...
passrthu a query with values if needed
[ "passrthu", "a", "query", "with", "values", "if", "needed" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L18-L61
29,888
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.select
public function select(array $array=[]) { // set the main action $this->action('SELECT'); // for each column foreach($array as $function_or_index_or_column => $column) { // secure the column name list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column, true); // if the ke...
php
public function select(array $array=[]) { // set the main action $this->action('SELECT'); // for each column foreach($array as $function_or_index_or_column => $column) { // secure the column name list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column, true); // if the ke...
[ "public", "function", "select", "(", "array", "$", "array", "=", "[", "]", ")", "{", "// set the main action", "$", "this", "->", "action", "(", "'SELECT'", ")", ";", "// for each column", "foreach", "(", "$", "array", "as", "$", "function_or_index_or_column",...
first main method
[ "first", "main", "method" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L64-L93
29,889
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.set
public function set(array $columns_and_values) { // for each provided strict condition foreach($columns_and_values as $column => $value) { // secure the column name list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column); // save the condition $this->Updates[] = "{$column...
php
public function set(array $columns_and_values) { // for each provided strict condition foreach($columns_and_values as $column => $value) { // secure the column name list($column, $placeholder) = Query\Convert::columnToPlaceholder($this->Quote ,$column); // save the condition $this->Updates[] = "{$column...
[ "public", "function", "set", "(", "array", "$", "columns_and_values", ")", "{", "// for each provided strict condition", "foreach", "(", "$", "columns_and_values", "as", "$", "column", "=>", "$", "value", ")", "{", "// secure the column name", "list", "(", "$", "c...
alias of update
[ "alias", "of", "update" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L96-L108
29,890
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.update
public function update(string $table) { // set the main action $this->action('UPDATE'); // set the destination table list($this->Table) = Query\Convert::columnToPlaceholder($this->Quote ,$table); // return self to the next method return $this; }
php
public function update(string $table) { // set the main action $this->action('UPDATE'); // set the destination table list($this->Table) = Query\Convert::columnToPlaceholder($this->Quote ,$table); // return self to the next method return $this; }
[ "public", "function", "update", "(", "string", "$", "table", ")", "{", "// set the main action", "$", "this", "->", "action", "(", "'UPDATE'", ")", ";", "// set the destination table", "list", "(", "$", "this", "->", "Table", ")", "=", "Query", "\\", "Conver...
second main method
[ "second", "main", "method" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L111-L118
29,891
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.from
public function from(string $table) { // set the table list($this->Table) = Query\Convert::columnToPlaceholder($this->Quote ,$table); // return self to the next method return $this; }
php
public function from(string $table) { // set the table list($this->Table) = Query\Convert::columnToPlaceholder($this->Quote ,$table); // return self to the next method return $this; }
[ "public", "function", "from", "(", "string", "$", "table", ")", "{", "// set the table", "list", "(", "$", "this", "->", "Table", ")", "=", "Query", "\\", "Convert", "::", "columnToPlaceholder", "(", "$", "this", "->", "Quote", ",", "$", "table", ")", ...
select the table
[ "select", "the", "table" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L146-L151
29,892
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.orderBy
public function orderBy(array $columns_and_direction) { // for each given parameter foreach($columns_and_direction as $column => $direction) { // if the direction is not valid force ASC $direction == 'ASC' || $direction == 'DESC' ?: $direction = 'ASC'; // secure the column name list($column) = Query\Con...
php
public function orderBy(array $columns_and_direction) { // for each given parameter foreach($columns_and_direction as $column => $direction) { // if the direction is not valid force ASC $direction == 'ASC' || $direction == 'DESC' ?: $direction = 'ASC'; // secure the column name list($column) = Query\Con...
[ "public", "function", "orderBy", "(", "array", "$", "columns_and_direction", ")", "{", "// for each given parameter", "foreach", "(", "$", "columns_and_direction", "as", "$", "column", "=>", "$", "direction", ")", "{", "// if the direction is not valid force ASC", "$", ...
add an order clause
[ "add", "an", "order", "clause" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L232-L244
29,893
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.groupBy
public function groupBy(array $columns) { // for each given parameter foreach($columns as $column) { // secure the column name list($column) = Query\Convert::columnToPlaceholder($this->Quote ,$column); // push it $this->Groups[] = $column; } // return self to the next method return $this; }
php
public function groupBy(array $columns) { // for each given parameter foreach($columns as $column) { // secure the column name list($column) = Query\Convert::columnToPlaceholder($this->Quote ,$column); // push it $this->Groups[] = $column; } // return self to the next method return $this; }
[ "public", "function", "groupBy", "(", "array", "$", "columns", ")", "{", "// for each given parameter", "foreach", "(", "$", "columns", "as", "$", "column", ")", "{", "// secure the column name", "list", "(", "$", "column", ")", "=", "Query", "\\", "Convert", ...
add a group clause
[ "add", "a", "group", "clause" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L247-L257
29,894
polyfony-inc/polyfony
Private/Polyfony/Query.php
Query.limitTo
public function limitTo(int $from, int $until) { // build the limit to $this->Limit = array($from, $until); // return self to the next method return $this; }
php
public function limitTo(int $from, int $until) { // build the limit to $this->Limit = array($from, $until); // return self to the next method return $this; }
[ "public", "function", "limitTo", "(", "int", "$", "from", ",", "int", "$", "until", ")", "{", "// build the limit to ", "$", "this", "->", "Limit", "=", "array", "(", "$", "from", ",", "$", "until", ")", ";", "// return self to the next method", "return", ...
add a limit clause
[ "add", "a", "limit", "clause" ]
76dac2f4141c8f480370236295c07dfa52e5c589
https://github.com/polyfony-inc/polyfony/blob/76dac2f4141c8f480370236295c07dfa52e5c589/Private/Polyfony/Query.php#L260-L265
29,895
ventoviro/windwalker-core
src/Debugger/Controller/Mail/GetController.php
GetController.doExecute
protected function doExecute() { $class = $this->input->getString('class'); $view = $this->getView(); if ($class && is_subclass_of($class, MailMessage::class)) { Mailer::getContainer() ->prepareSharedObject(DebugMailerAdapter::class) ->bindShared...
php
protected function doExecute() { $class = $this->input->getString('class'); $view = $this->getView(); if ($class && is_subclass_of($class, MailMessage::class)) { Mailer::getContainer() ->prepareSharedObject(DebugMailerAdapter::class) ->bindShared...
[ "protected", "function", "doExecute", "(", ")", "{", "$", "class", "=", "$", "this", "->", "input", "->", "getString", "(", "'class'", ")", ";", "$", "view", "=", "$", "this", "->", "getView", "(", ")", ";", "if", "(", "$", "class", "&&", "is_subcl...
Do execute action. @return mixed @throws \Exception
[ "Do", "execute", "action", "." ]
0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074
https://github.com/ventoviro/windwalker-core/blob/0ed53059fc2d5d2d9b72f0e4aeef2fdf6aac0074/src/Debugger/Controller/Mail/GetController.php#L31-L60
29,896
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.attachData
static public function attachData(Request $request, $body): Request { $headers = $request->getHeaders(); if (is_string($body) && file_exists($body)) { $filename = rawurldecode(basename($body)); // lucky guess - unfortunately it is not clear how to escape header values ...
php
static public function attachData(Request $request, $body): Request { $headers = $request->getHeaders(); if (is_string($body) && file_exists($body)) { $filename = rawurldecode(basename($body)); // lucky guess - unfortunately it is not clear how to escape header values ...
[ "static", "public", "function", "attachData", "(", "Request", "$", "request", ",", "$", "body", ")", ":", "Request", "{", "$", "headers", "=", "$", "request", "->", "getHeaders", "(", ")", ";", "if", "(", "is_string", "(", "$", "body", ")", "&&", "fi...
Attaches binary content to a given Guzzle HTTP request @param \GuzzleHttp\Psr7\Request $request HTTP request @param $body binary content to be attached It can be a file name, an URL, an array or a normal string. If it is an URL, a "redirecting Fedora resource" will be created. If it is an array, it should contain fiel...
[ "Attaches", "binary", "content", "to", "a", "given", "Guzzle", "HTTP", "request" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L88-L108
29,897
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.createResource
public function createResource(Resource $metadata, $data = '', string $path = '', string $method = 'POST'): FedoraResource { if (!in_array($method, array('POST', 'PUT'))) { throw new BadMethodCallException('method must be PUT or POST'); } $baseUrl =...
php
public function createResource(Resource $metadata, $data = '', string $path = '', string $method = 'POST'): FedoraResource { if (!in_array($method, array('POST', 'PUT'))) { throw new BadMethodCallException('method must be PUT or POST'); } $baseUrl =...
[ "public", "function", "createResource", "(", "Resource", "$", "metadata", ",", "$", "data", "=", "''", ",", "string", "$", "path", "=", "''", ",", "string", "$", "method", "=", "'POST'", ")", ":", "FedoraResource", "{", "if", "(", "!", "in_array", "(",...
Creates a resource in the Fedora and returns corresponding Resource object @param EasyRdf\Resource $metadata resource metadata @param mixed $data optional resource data as a string, file name or an array: ['content-type' => 'foo', 'data' => 'bar'] @param string $path optional Fedora resource path (see also the `$metho...
[ "Creates", "a", "resource", "in", "the", "Fedora", "and", "returns", "corresponding", "Resource", "object" ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L274-L301
29,898
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.sendRequest
public function sendRequest(Request $request): Response { if ($this->txUrl && time() - $this->txTimestamp > $this->txKeepAlive) { $this->prolong(); } try { $response = $this->client->send($request); // Fedora triplestore plugin doesn't index resources which w...
php
public function sendRequest(Request $request): Response { if ($this->txUrl && time() - $this->txTimestamp > $this->txKeepAlive) { $this->prolong(); } try { $response = $this->client->send($request); // Fedora triplestore plugin doesn't index resources which w...
[ "public", "function", "sendRequest", "(", "Request", "$", "request", ")", ":", "Response", "{", "if", "(", "$", "this", "->", "txUrl", "&&", "time", "(", ")", "-", "$", "this", "->", "txTimestamp", ">", "$", "this", "->", "txKeepAlive", ")", "{", "$"...
Sends a given HTTP request to the Fedora. Switches most important errors into specific error classes. @param Request $request request to be send @return Response @throws Deleted @throws NotFound @throws RequestException
[ "Sends", "a", "given", "HTTP", "request", "to", "the", "Fedora", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L313-L338
29,899
acdh-oeaw/repo-php-util
src/acdhOeaw/fedora/Fedora.php
Fedora.getResourceByUri
public function getResourceByUri(string $uri): FedoraResource { $uri = $this->standardizeUri($uri); try { return $this->cache->getByUri($uri); } catch (NotInCache $e) { return new FedoraResource($this, $uri); } }
php
public function getResourceByUri(string $uri): FedoraResource { $uri = $this->standardizeUri($uri); try { return $this->cache->getByUri($uri); } catch (NotInCache $e) { return new FedoraResource($this, $uri); } }
[ "public", "function", "getResourceByUri", "(", "string", "$", "uri", ")", ":", "FedoraResource", "{", "$", "uri", "=", "$", "this", "->", "standardizeUri", "(", "$", "uri", ")", ";", "try", "{", "return", "$", "this", "->", "cache", "->", "getByUri", "...
Returns a FedoraResource based on a given URI. Request URI is imported into the current connection meaning base Fedora API URL will and the current transaction URI (if there is an active transaction) will replace ones in passed URI. It is not checked if a resource with a given URI exists. @param string $uri @return ...
[ "Returns", "a", "FedoraResource", "based", "on", "a", "given", "URI", "." ]
e22c7cd2613f3c8daf0deee879896d9cd7f61b41
https://github.com/acdh-oeaw/repo-php-util/blob/e22c7cd2613f3c8daf0deee879896d9cd7f61b41/src/acdhOeaw/fedora/Fedora.php#L352-L359