id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26,500 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.transformRequest | public function transformRequest($api, $endpoint, Request $requestIn, Request $requestOut)
{
$transformations = $this->getRequestTransformations($api, $endpoint);
if (!empty($transformations)) {
foreach ($transformations as $transformation) {
$transformedRequest = $trans... | php | public function transformRequest($api, $endpoint, Request $requestIn, Request $requestOut)
{
$transformations = $this->getRequestTransformations($api, $endpoint);
if (!empty($transformations)) {
foreach ($transformations as $transformation) {
$transformedRequest = $trans... | [
"public",
"function",
"transformRequest",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"Request",
"$",
"requestIn",
",",
"Request",
"$",
"requestOut",
")",
"{",
"$",
"transformations",
"=",
"$",
"this",
"->",
"getRequestTransformations",
"(",
"$",
"api",
",",... | Applies all transformations defined for the given API and endpoint on a request.
@param string $api The API name
@param string $endpoint The endpoint
@param Request $requestIn The original request object.
@param Request $requestOut The request object to use for transformations
@return Request The trans... | [
"Applies",
"all",
"transformations",
"defined",
"for",
"the",
"given",
"API",
"and",
"endpoint",
"on",
"a",
"request",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L48-L63 |
26,501 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.transformResponse | public function transformResponse($api, $endpoint, Response $responseIn, Response $responseOut)
{
$transformations = $this->getResponseTransformations($api, $endpoint);
foreach ($transformations as $transformation) {
$transformedRequest = $transformation->transformResponse($responseIn, $... | php | public function transformResponse($api, $endpoint, Response $responseIn, Response $responseOut)
{
$transformations = $this->getResponseTransformations($api, $endpoint);
foreach ($transformations as $transformation) {
$transformedRequest = $transformation->transformResponse($responseIn, $... | [
"public",
"function",
"transformResponse",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"Response",
"$",
"responseIn",
",",
"Response",
"$",
"responseOut",
")",
"{",
"$",
"transformations",
"=",
"$",
"this",
"->",
"getResponseTransformations",
"(",
"$",
"api",
... | Applies all transformations defined for the given API and endpoint on a response.
@param string $api The API name
@param string $endpoint The endpoint
@param Response $responseIn The original response object
@param Response $responseOut The response object to use for transformations
@return Respons... | [
"Applies",
"all",
"transformations",
"defined",
"for",
"the",
"given",
"API",
"and",
"endpoint",
"on",
"a",
"response",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L74-L82 |
26,502 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.transformSchema | public function transformSchema($api, $endpoint, \stdClass $schemaIn, \stdClass $schemaOut)
{
$transformations = $this->getSchemaTransformations($api, $endpoint);
foreach ($transformations as $transformation) {
$transformedSchema = $transformation->transformSchema($schemaIn, $schemaOut);... | php | public function transformSchema($api, $endpoint, \stdClass $schemaIn, \stdClass $schemaOut)
{
$transformations = $this->getSchemaTransformations($api, $endpoint);
foreach ($transformations as $transformation) {
$transformedSchema = $transformation->transformSchema($schemaIn, $schemaOut);... | [
"public",
"function",
"transformSchema",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"\\",
"stdClass",
"$",
"schemaIn",
",",
"\\",
"stdClass",
"$",
"schemaOut",
")",
"{",
"$",
"transformations",
"=",
"$",
"this",
"->",
"getSchemaTransformations",
"(",
"$",
... | Applies all transformations defined for the given API and endpoint on a schema.
@param string $api The API name
@param string $endpoint The endpoint
@param \stdClass $schemaIn The original schema object
@param \stdClass $schemaOut The schema object to use for transformations
@return \stdClass The tra... | [
"Applies",
"all",
"transformations",
"defined",
"for",
"the",
"given",
"API",
"and",
"endpoint",
"on",
"a",
"schema",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L93-L101 |
26,503 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.getRequestTransformations | public function getRequestTransformations($api, $endpoint)
{
if (isset($this->requestTransformations[$api])) {
$patterns = array_keys($this->requestTransformations[$api]);
foreach ($patterns as $pattern) {
preg_match($pattern, $endpoint, $matches);
i... | php | public function getRequestTransformations($api, $endpoint)
{
if (isset($this->requestTransformations[$api])) {
$patterns = array_keys($this->requestTransformations[$api]);
foreach ($patterns as $pattern) {
preg_match($pattern, $endpoint, $matches);
i... | [
"public",
"function",
"getRequestTransformations",
"(",
"$",
"api",
",",
"$",
"endpoint",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"requestTransformations",
"[",
"$",
"api",
"]",
")",
")",
"{",
"$",
"patterns",
"=",
"array_keys",
"(",
"$",
... | Returns the request transformations registered for a given API and endpoint.
@param string $api The API name
@param string $endpoint The endpoint
@return array The transformations | [
"Returns",
"the",
"request",
"transformations",
"registered",
"for",
"a",
"given",
"API",
"and",
"endpoint",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L110-L125 |
26,504 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.addRequestTransformation | public function addRequestTransformation($api, $endpoint, RequestTransformationInterface $transformation)
{
$this->requestTransformations[$api][$endpoint][] = $transformation;
return count($this->requestTransformations[$api][$endpoint]) - 1;
} | php | public function addRequestTransformation($api, $endpoint, RequestTransformationInterface $transformation)
{
$this->requestTransformations[$api][$endpoint][] = $transformation;
return count($this->requestTransformations[$api][$endpoint]) - 1;
} | [
"public",
"function",
"addRequestTransformation",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"RequestTransformationInterface",
"$",
"transformation",
")",
"{",
"$",
"this",
"->",
"requestTransformations",
"[",
"$",
"api",
"]",
"[",
"$",
"endpoint",
"]",
"[",
... | Adds a transformation to a given API and endpoint.
@param string $api The API name
@param string $endpoint The API endpoint
@param RequestTransformationInterface $transformation The transformation
@return int The position of the added transformation w... | [
"Adds",
"a",
"transformation",
"to",
"a",
"given",
"API",
"and",
"endpoint",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L161-L165 |
26,505 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.addResponseTransformation | public function addResponseTransformation($api, $endpoint, ResponseTransformationInterface $transformation)
{
$this->responseTransformations[$api][$endpoint][] = $transformation;
return count($this->responseTransformations[$api][$endpoint]) - 1;
} | php | public function addResponseTransformation($api, $endpoint, ResponseTransformationInterface $transformation)
{
$this->responseTransformations[$api][$endpoint][] = $transformation;
return count($this->responseTransformations[$api][$endpoint]) - 1;
} | [
"public",
"function",
"addResponseTransformation",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"ResponseTransformationInterface",
"$",
"transformation",
")",
"{",
"$",
"this",
"->",
"responseTransformations",
"[",
"$",
"api",
"]",
"[",
"$",
"endpoint",
"]",
"[",... | Adds a response transformation to a given API and endpoint.
@param string $api The API name
@param string $endpoint The API endpoint
@param ResponseTransformationInterface $transformation The transformation
@return int The position of the added tran... | [
"Adds",
"a",
"response",
"transformation",
"to",
"a",
"given",
"API",
"and",
"endpoint",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L175-L179 |
26,506 | libgraviton/graviton | src/Graviton/ProxyBundle/Service/TransformationHandler.php | TransformationHandler.addSchemaTransformation | public function addSchemaTransformation($api, $endpoint, SchemaTransformationInterface $transformation)
{
$this->schemaTransformations[$api][$endpoint][] = $transformation;
return count($this->schemaTransformations[$api][$endpoint]) - 1;
} | php | public function addSchemaTransformation($api, $endpoint, SchemaTransformationInterface $transformation)
{
$this->schemaTransformations[$api][$endpoint][] = $transformation;
return count($this->schemaTransformations[$api][$endpoint]) - 1;
} | [
"public",
"function",
"addSchemaTransformation",
"(",
"$",
"api",
",",
"$",
"endpoint",
",",
"SchemaTransformationInterface",
"$",
"transformation",
")",
"{",
"$",
"this",
"->",
"schemaTransformations",
"[",
"$",
"api",
"]",
"[",
"$",
"endpoint",
"]",
"[",
"]"... | Adds a schema transformation to a given API and endpoint.
@param string $api The API name
@param string $endpoint The API endpoint
@param SchemaTransformationInterface $transformation The transformation
@return int The position of the added transformati... | [
"Adds",
"a",
"schema",
"transformation",
"to",
"a",
"given",
"API",
"and",
"endpoint",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Service/TransformationHandler.php#L189-L193 |
26,507 | libgraviton/graviton | src/Graviton/AnalyticsBundle/Helper/JsonMapper.php | JsonMapper.map | public function map($json, $object)
{
foreach ($json as $key => $jvalue) {
$key = $this->getSafeName($key);
$setter = 'set' . $this->getCamelCaseName($key);
if (method_exists($object, $setter)) {
$object->{$setter}($jvalue);
}
}
... | php | public function map($json, $object)
{
foreach ($json as $key => $jvalue) {
$key = $this->getSafeName($key);
$setter = 'set' . $this->getCamelCaseName($key);
if (method_exists($object, $setter)) {
$object->{$setter}($jvalue);
}
}
... | [
"public",
"function",
"map",
"(",
"$",
"json",
",",
"$",
"object",
")",
"{",
"foreach",
"(",
"$",
"json",
"as",
"$",
"key",
"=>",
"$",
"jvalue",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getSafeName",
"(",
"$",
"key",
")",
";",
"$",
"sette... | Maps data into object class
@param object $json to be casted
@param object $object Class to receive data
@throws InvalidArgumentException
@return object | [
"Maps",
"data",
"into",
"object",
"class"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/AnalyticsBundle/Helper/JsonMapper.php#L26-L38 |
26,508 | libgraviton/graviton | src/Graviton/SchemaBundle/Model/SchemaModel.php | SchemaModel.manyPropertyModelForTarget | public function manyPropertyModelForTarget($mapping)
{
// @todo refactor to get rid of container dependency (maybe remove from here)
list($app, $bundle, , $document) = explode('\\', $mapping);
$app = strtolower($app);
$bundle = strtolower(substr($bundle, 0, -6));
$document = ... | php | public function manyPropertyModelForTarget($mapping)
{
// @todo refactor to get rid of container dependency (maybe remove from here)
list($app, $bundle, , $document) = explode('\\', $mapping);
$app = strtolower($app);
$bundle = strtolower(substr($bundle, 0, -6));
$document = ... | [
"public",
"function",
"manyPropertyModelForTarget",
"(",
"$",
"mapping",
")",
"{",
"// @todo refactor to get rid of container dependency (maybe remove from here)",
"list",
"(",
"$",
"app",
",",
"$",
"bundle",
",",
",",
"$",
"document",
")",
"=",
"explode",
"(",
"'\\\\... | get property model for embedded field
@param string $mapping name of mapping class
@return $this | [
"get",
"property",
"model",
"for",
"embedded",
"field"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/SchemaBundle/Model/SchemaModel.php#L176-L187 |
26,509 | libgraviton/graviton | src/Graviton/SchemaBundle/Model/SchemaModel.php | SchemaModel.getRequiredFields | public function getRequiredFields($variationName = null)
{
if (is_null($variationName)) {
return $this->schema->required;
}
/* compose required fields based on variation */
$requiredFields = $this->getRequiredFields();
foreach ($this->schema->properties as $field... | php | public function getRequiredFields($variationName = null)
{
if (is_null($variationName)) {
return $this->schema->required;
}
/* compose required fields based on variation */
$requiredFields = $this->getRequiredFields();
foreach ($this->schema->properties as $field... | [
"public",
"function",
"getRequiredFields",
"(",
"$",
"variationName",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"variationName",
")",
")",
"{",
"return",
"$",
"this",
"->",
"schema",
"->",
"required",
";",
"}",
"/* compose required fields based on... | get required fields for this object
@param string $variationName a variation that can alter which fields are required
@return string[] | [
"get",
"required",
"fields",
"for",
"this",
"object"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/SchemaBundle/Model/SchemaModel.php#L196-L229 |
26,510 | libgraviton/graviton | src/Graviton/SchemaBundle/Model/SchemaModel.php | SchemaModel.getDocumentClass | public function getDocumentClass()
{
$documentClass = false;
if (isset($this->schema->{'x-documentClass'})) {
$documentClass = $this->schema->{'x-documentClass'};
}
return $documentClass;
} | php | public function getDocumentClass()
{
$documentClass = false;
if (isset($this->schema->{'x-documentClass'})) {
$documentClass = $this->schema->{'x-documentClass'};
}
return $documentClass;
} | [
"public",
"function",
"getDocumentClass",
"(",
")",
"{",
"$",
"documentClass",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"schema",
"->",
"{",
"'x-documentClass'",
"}",
")",
")",
"{",
"$",
"documentClass",
"=",
"$",
"this",
"->",
"s... | Gets the defined document class in shortform from schema
@return string|false either the document class or false it not given | [
"Gets",
"the",
"defined",
"document",
"class",
"in",
"shortform",
"from",
"schema"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/SchemaBundle/Model/SchemaModel.php#L308-L315 |
26,511 | libgraviton/graviton | src/Graviton/SchemaBundle/Model/SchemaModel.php | SchemaModel.getSchemaField | private function getSchemaField($field, $property, $fallbackValue = '')
{
if (isset($this->schema->properties->$field->$property)) {
$fallbackValue = $this->schema->properties->$field->$property;
}
return $fallbackValue;
} | php | private function getSchemaField($field, $property, $fallbackValue = '')
{
if (isset($this->schema->properties->$field->$property)) {
$fallbackValue = $this->schema->properties->$field->$property;
}
return $fallbackValue;
} | [
"private",
"function",
"getSchemaField",
"(",
"$",
"field",
",",
"$",
"property",
",",
"$",
"fallbackValue",
"=",
"''",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"schema",
"->",
"properties",
"->",
"$",
"field",
"->",
"$",
"property",
")",
... | get schema field value
@param string $field field name
@param string $property property name
@param mixed $fallbackValue fallback value if property isn't set
@return mixed | [
"get",
"schema",
"field",
"value"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/SchemaBundle/Model/SchemaModel.php#L378-L385 |
26,512 | duncan3dc/domparser | src/ParserTrait.php | ParserTrait.getData | protected function getData($data)
{
$method = "load" . strtoupper($this->mode);
libxml_use_internal_errors(true);
$this->dom->$method($data);
$this->errors = libxml_get_errors();
libxml_clear_errors();
return $data;
} | php | protected function getData($data)
{
$method = "load" . strtoupper($this->mode);
libxml_use_internal_errors(true);
$this->dom->$method($data);
$this->errors = libxml_get_errors();
libxml_clear_errors();
return $data;
} | [
"protected",
"function",
"getData",
"(",
"$",
"data",
")",
"{",
"$",
"method",
"=",
"\"load\"",
".",
"strtoupper",
"(",
"$",
"this",
"->",
"mode",
")",
";",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"this",
"->",
"dom",
"->",
"$",
"meth... | Get the content for parsing.
Creates an internal dom instance.
@param string $data The xml/html
@return string The xml/html | [
"Get",
"the",
"content",
"for",
"parsing",
"."
] | d5523b58337cab3b9ad90e8d135f87793795f93f | https://github.com/duncan3dc/domparser/blob/d5523b58337cab3b9ad90e8d135f87793795f93f/src/ParserTrait.php#L24-L34 |
26,513 | duncan3dc/domparser | src/ParserTrait.php | ParserTrait.xpath | public function xpath($path)
{
$xpath = new \DOMXPath($this->dom);
$list = $xpath->query($path);
$return = [];
foreach ($list as $node) {
$return[] = $this->newElement($node);
}
return $return;
} | php | public function xpath($path)
{
$xpath = new \DOMXPath($this->dom);
$list = $xpath->query($path);
$return = [];
foreach ($list as $node) {
$return[] = $this->newElement($node);
}
return $return;
} | [
"public",
"function",
"xpath",
"(",
"$",
"path",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"this",
"->",
"dom",
")",
";",
"$",
"list",
"=",
"$",
"xpath",
"->",
"query",
"(",
"$",
"path",
")",
";",
"$",
"return",
"=",
"[",
... | Get elements using an xpath selector.
@param string $path The xpath selector
@return Element[] | [
"Get",
"elements",
"using",
"an",
"xpath",
"selector",
"."
] | d5523b58337cab3b9ad90e8d135f87793795f93f | https://github.com/duncan3dc/domparser/blob/d5523b58337cab3b9ad90e8d135f87793795f93f/src/ParserTrait.php#L44-L56 |
26,514 | libgraviton/graviton | src/Graviton/MigrationBundle/Command/MongodbMigrateCommand.php | MongodbMigrateCommand.execute | public function execute(InputInterface $input, OutputInterface $output)
{
// graviton root
$baseDir = __DIR__.'/../../../';
// vendorized? - go back some more..
if (strpos($baseDir, '/vendor/') !== false) {
$baseDir .= '../../../';
}
$this->finder
... | php | public function execute(InputInterface $input, OutputInterface $output)
{
// graviton root
$baseDir = __DIR__.'/../../../';
// vendorized? - go back some more..
if (strpos($baseDir, '/vendor/') !== false) {
$baseDir .= '../../../';
}
$this->finder
... | [
"public",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"// graviton root",
"$",
"baseDir",
"=",
"__DIR__",
".",
"'/../../../'",
";",
"// vendorized? - go back some more..",
"if",
"(",
"strpos",
"(",
"... | call execute on found commands
@param InputInterface $input user input
@param OutputInterface $output command output
@return void | [
"call",
"execute",
"on",
"found",
"commands"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/MigrationBundle/Command/MongodbMigrateCommand.php#L90-L147 |
26,515 | libgraviton/graviton | src/Graviton/MigrationBundle/Command/MongodbMigrateCommand.php | MongodbMigrateCommand.getConfiguration | private function getConfiguration($filepath, $output)
{
$outputWriter = new OutputWriter(
function ($message) use ($output) {
return $output->writeln($message);
}
);
$info = pathinfo($filepath);
$namespace = 'AntiMattr\MongoDB\Migrations\Confi... | php | private function getConfiguration($filepath, $output)
{
$outputWriter = new OutputWriter(
function ($message) use ($output) {
return $output->writeln($message);
}
);
$info = pathinfo($filepath);
$namespace = 'AntiMattr\MongoDB\Migrations\Confi... | [
"private",
"function",
"getConfiguration",
"(",
"$",
"filepath",
",",
"$",
"output",
")",
"{",
"$",
"outputWriter",
"=",
"new",
"OutputWriter",
"(",
"function",
"(",
"$",
"message",
")",
"use",
"(",
"$",
"output",
")",
"{",
"return",
"$",
"output",
"->",... | get configration object for migration script
This is based on antromattr/mongodb-migartion code but extends it so we can inject
non local stuff centrally.
@param string $filepath path to configuration file
@param Output $output ouput interface need by config parser to do stuff
@return AntiMattr\MongoDB\Migrations\... | [
"get",
"configration",
"object",
"for",
"migration",
"script"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/MigrationBundle/Command/MongodbMigrateCommand.php#L160-L181 |
26,516 | libgraviton/graviton | src/Graviton/FileBundle/Manager/RequestManager.php | RequestManager.updateFileRequest | public function updateFileRequest(Request $request)
{
$original = $this->requestStack->getMasterRequest();
$input = $original ? $original->getContent() : false;
if (!$input) {
return $request;
}
$part = new Part((string) $request);
if ($part->isMultiPar... | php | public function updateFileRequest(Request $request)
{
$original = $this->requestStack->getMasterRequest();
$input = $original ? $original->getContent() : false;
if (!$input) {
return $request;
}
$part = new Part((string) $request);
if ($part->isMultiPar... | [
"public",
"function",
"updateFileRequest",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"original",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getMasterRequest",
"(",
")",
";",
"$",
"input",
"=",
"$",
"original",
"?",
"$",
"original",
"->",
"getConte... | Simple RAW http request parser.
Ideal for PUT requests where PUT is streamed but you still need the data.
@param Request $request Sf data request
@return Request | [
"Simple",
"RAW",
"http",
"request",
"parser",
".",
"Ideal",
"for",
"PUT",
"requests",
"where",
"PUT",
"is",
"streamed",
"but",
"you",
"still",
"need",
"the",
"data",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/FileBundle/Manager/RequestManager.php#L44-L88 |
26,517 | libgraviton/graviton | src/Graviton/FileBundle/Manager/RequestManager.php | RequestManager.extractFileFromString | private function extractFileFromString($fileContent, $originalFileName = null)
{
$tmpName = $fileName = uniqid(true);
if (!is_null($originalFileName)) {
$fileName = $originalFileName;
}
$dir = ini_get('upload_tmp_dir');
$dir = (empty($dir)) ? sys_get_temp_dir() ... | php | private function extractFileFromString($fileContent, $originalFileName = null)
{
$tmpName = $fileName = uniqid(true);
if (!is_null($originalFileName)) {
$fileName = $originalFileName;
}
$dir = ini_get('upload_tmp_dir');
$dir = (empty($dir)) ? sys_get_temp_dir() ... | [
"private",
"function",
"extractFileFromString",
"(",
"$",
"fileContent",
",",
"$",
"originalFileName",
"=",
"null",
")",
"{",
"$",
"tmpName",
"=",
"$",
"fileName",
"=",
"uniqid",
"(",
"true",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"originalFileName... | Extracts file data from request content
@param string $fileContent the file content
@param string $originalFileName an overriding original file name
@return false|UploadedFile | [
"Extracts",
"file",
"data",
"from",
"request",
"content"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/FileBundle/Manager/RequestManager.php#L98-L120 |
26,518 | libgraviton/graviton | src/Graviton/DocumentBundle/GravitonDocumentBundle.php | GravitonDocumentBundle.boot | public function boot()
{
$extRefConverter = $this->container->get('graviton.document.service.extrefconverter');
$customType = Type::getType('hash');
$customType->setExtRefConverter($extRefConverter);
} | php | public function boot()
{
$extRefConverter = $this->container->get('graviton.document.service.extrefconverter');
$customType = Type::getType('hash');
$customType->setExtRefConverter($extRefConverter);
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"extRefConverter",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'graviton.document.service.extrefconverter'",
")",
";",
"$",
"customType",
"=",
"Type",
"::",
"getType",
"(",
"'hash'",
")",
";",
"$"... | boot bundle function
@return void | [
"boot",
"bundle",
"function"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/GravitonDocumentBundle.php#L126-L131 |
26,519 | libgraviton/graviton | src/Graviton/CoreBundle/Compiler/VersionCompilerPass.php | VersionCompilerPass.process | public function process(ContainerBuilder $container)
{
$rootDir = $container->getParameter('kernel.root_dir');
if (strpos($rootDir, 'vendor') !== false) {
$configurationFile = $rootDir.'/../../../../app';
} else {
$configurationFile = $rootDir;
}
$co... | php | public function process(ContainerBuilder $container)
{
$rootDir = $container->getParameter('kernel.root_dir');
if (strpos($rootDir, 'vendor') !== false) {
$configurationFile = $rootDir.'/../../../../app';
} else {
$configurationFile = $rootDir;
}
$co... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"rootDir",
"=",
"$",
"container",
"->",
"getParameter",
"(",
"'kernel.root_dir'",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"rootDir",
",",
"'vendor'",
")",
"!==",
"f... | add version information of packages to the container
@param ContainerBuilder $container Container
@return void | [
"add",
"version",
"information",
"of",
"packages",
"to",
"the",
"container"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/CoreBundle/Compiler/VersionCompilerPass.php#L41-L88 |
26,520 | libgraviton/graviton | src/Graviton/DocumentBundle/Listener/DocumentVersionListener.php | DocumentVersionListener.updateCounter | private function updateCounter(ModelEvent $event, $action)
{
if (!$this->constraint->isVersioningService()) {
return;
}
$qb = $this->documentManager->createQueryBuilder($event->getCollectionClass());
if ('update' == $action) {
$qb->findAndUpdate()
... | php | private function updateCounter(ModelEvent $event, $action)
{
if (!$this->constraint->isVersioningService()) {
return;
}
$qb = $this->documentManager->createQueryBuilder($event->getCollectionClass());
if ('update' == $action) {
$qb->findAndUpdate()
... | [
"private",
"function",
"updateCounter",
"(",
"ModelEvent",
"$",
"event",
",",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"constraint",
"->",
"isVersioningService",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"qb",
"=",
"$",
"this",
... | Update Counter for all new saved items
@param ModelEvent $event Object event
@param string $action What is to be done
@return void | [
"Update",
"Counter",
"for",
"all",
"new",
"saved",
"items"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Listener/DocumentVersionListener.php#L68-L86 |
26,521 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.isConfigured | public function isConfigured()
{
if (!empty($this->urlParts) && isset($this->solrMap[$this->className])) {
return true;
}
return false;
} | php | public function isConfigured()
{
if (!empty($this->urlParts) && isset($this->solrMap[$this->className])) {
return true;
}
return false;
} | [
"public",
"function",
"isConfigured",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"urlParts",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"solrMap",
"[",
"$",
"this",
"->",
"className",
"]",
")",
")",
"{",
"return",
"true",
";",... | returns true if solr is configured currently, false otherwise
@return bool if solr is configured | [
"returns",
"true",
"if",
"solr",
"is",
"configured",
"currently",
"false",
"otherwise"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L148-L154 |
26,522 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.query | public function query(SearchNode $node, LimitNode $limitNode = null)
{
$client = $this->getClient();
$query = $client->createQuery($client::QUERY_SELECT);
// set the weights
$query->getEDisMax()->setQueryFields($this->solrMap[$this->className]);
$query->setQuery($this->get... | php | public function query(SearchNode $node, LimitNode $limitNode = null)
{
$client = $this->getClient();
$query = $client->createQuery($client::QUERY_SELECT);
// set the weights
$query->getEDisMax()->setQueryFields($this->solrMap[$this->className]);
$query->setQuery($this->get... | [
"public",
"function",
"query",
"(",
"SearchNode",
"$",
"node",
",",
"LimitNode",
"$",
"limitNode",
"=",
"null",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"$",
"query",
"=",
"$",
"client",
"->",
"createQuery",
"(",
"... | executes the search on solr using the rql parsing nodes.
@param SearchNode $node search node
@param LimitNode|null $limitNode limit node
@return array an array of just record ids (the ids of the matching documents in solr) | [
"executes",
"the",
"search",
"on",
"solr",
"using",
"the",
"rql",
"parsing",
"nodes",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L164-L200 |
26,523 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.getSearchTerm | private function getSearchTerm(SearchNode $node)
{
$fullTerm = $node->getSearchQuery();
foreach ($this->fullTermPatterns as $pattern) {
if (preg_match($pattern, $fullTerm, $matches) === 1) {
return '"'.$fullTerm.'"';
}
}
if ($this->andifyTerm... | php | private function getSearchTerm(SearchNode $node)
{
$fullTerm = $node->getSearchQuery();
foreach ($this->fullTermPatterns as $pattern) {
if (preg_match($pattern, $fullTerm, $matches) === 1) {
return '"'.$fullTerm.'"';
}
}
if ($this->andifyTerm... | [
"private",
"function",
"getSearchTerm",
"(",
"SearchNode",
"$",
"node",
")",
"{",
"$",
"fullTerm",
"=",
"$",
"node",
"->",
"getSearchQuery",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"fullTermPatterns",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
... | returns the string search term to be used in the solr query
@param SearchNode $node the search node
@return string the composed search query | [
"returns",
"the",
"string",
"search",
"term",
"to",
"be",
"used",
"in",
"the",
"solr",
"query"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L209-L252 |
26,524 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.getSingleTerm | private function getSingleTerm($term)
{
// we don't modify numbers
if (ctype_digit($term)) {
return '"'.$term.'"';
}
// formatted number?
$formatted = str_replace(
[
'-',
'.'
],
'',
$... | php | private function getSingleTerm($term)
{
// we don't modify numbers
if (ctype_digit($term)) {
return '"'.$term.'"';
}
// formatted number?
$formatted = str_replace(
[
'-',
'.'
],
'',
$... | [
"private",
"function",
"getSingleTerm",
"(",
"$",
"term",
")",
"{",
"// we don't modify numbers",
"if",
"(",
"ctype_digit",
"(",
"$",
"term",
")",
")",
"{",
"return",
"'\"'",
".",
"$",
"term",
".",
"'\"'",
";",
"}",
"// formatted number?",
"$",
"formatted",
... | returns a single term how to search. here we can apply custom logic to the user input string
@param string $term single search term
@return string modified search term | [
"returns",
"a",
"single",
"term",
"how",
"to",
"search",
".",
"here",
"we",
"can",
"apply",
"custom",
"logic",
"to",
"the",
"user",
"input",
"string"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L261-L303 |
26,525 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.doAndNotPrefixSingleTerm | private function doAndNotPrefixSingleTerm($term, $modifier)
{
// already modifier there?
$last = substr($term, -1);
if ($last == '~' || $last == '*') {
// clean from term, override modifier from client
$modifier = $last;
$term = substr($term, 0, -1);
... | php | private function doAndNotPrefixSingleTerm($term, $modifier)
{
// already modifier there?
$last = substr($term, -1);
if ($last == '~' || $last == '*') {
// clean from term, override modifier from client
$modifier = $last;
$term = substr($term, 0, -1);
... | [
"private",
"function",
"doAndNotPrefixSingleTerm",
"(",
"$",
"term",
",",
"$",
"modifier",
")",
"{",
"// already modifier there?",
"$",
"last",
"=",
"substr",
"(",
"$",
"term",
",",
"-",
"1",
")",
";",
"if",
"(",
"$",
"last",
"==",
"'~'",
"||",
"$",
"l... | ORify a single term
@param string $term search term
@param string $modifier modified
@return string ORified query | [
"ORify",
"a",
"single",
"term"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L339-L355 |
26,526 | libgraviton/graviton | src/Graviton/DocumentBundle/Service/SolrQuery.php | SolrQuery.getClient | private function getClient()
{
$endpointConfig = $this->urlParts;
if (!isset($endpointConfig['path'])) {
$endpointConfig['path'] = '/';
}
if (substr($endpointConfig['path'], -1) != '/') {
$endpointConfig['path'] .= '/';
}
// find core name
... | php | private function getClient()
{
$endpointConfig = $this->urlParts;
if (!isset($endpointConfig['path'])) {
$endpointConfig['path'] = '/';
}
if (substr($endpointConfig['path'], -1) != '/') {
$endpointConfig['path'] .= '/';
}
// find core name
... | [
"private",
"function",
"getClient",
"(",
")",
"{",
"$",
"endpointConfig",
"=",
"$",
"this",
"->",
"urlParts",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"endpointConfig",
"[",
"'path'",
"]",
")",
")",
"{",
"$",
"endpointConfig",
"[",
"'path'",
"]",
"=",
... | returns the client to use for the current query
@return Client client | [
"returns",
"the",
"client",
"to",
"use",
"for",
"the",
"current",
"query"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Service/SolrQuery.php#L362-L384 |
26,527 | libgraviton/graviton | src/Graviton/ProxyBundle/Transformation/BodyMapping.php | BodyMapping.transformResponse | public function transformResponse(Response $responseIn, Response $responseOut)
{
$responseOut->setContent(
json_encode($this->transformer->transform($responseIn->getContent(), $this->mapping))
);
} | php | public function transformResponse(Response $responseIn, Response $responseOut)
{
$responseOut->setContent(
json_encode($this->transformer->transform($responseIn->getContent(), $this->mapping))
);
} | [
"public",
"function",
"transformResponse",
"(",
"Response",
"$",
"responseIn",
",",
"Response",
"$",
"responseOut",
")",
"{",
"$",
"responseOut",
"->",
"setContent",
"(",
"json_encode",
"(",
"$",
"this",
"->",
"transformer",
"->",
"transform",
"(",
"$",
"respo... | Transforms a response
@param Response $responseIn The original response object
@param Response $responseOut The response object to transform
@return void | [
"Transforms",
"a",
"response"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Transformation/BodyMapping.php#L50-L55 |
26,528 | libgraviton/graviton | src/Graviton/ProxyBundle/Transformation/BodyMapping.php | BodyMapping.transformRequest | public function transformRequest(Request $requestIn, Request $requestOut)
{
$requestOut = Request::create(
$requestOut->getUri(),
$requestOut->getMethod(),
[],
[],
[],
[],
json_encode(
$this->transformer->tra... | php | public function transformRequest(Request $requestIn, Request $requestOut)
{
$requestOut = Request::create(
$requestOut->getUri(),
$requestOut->getMethod(),
[],
[],
[],
[],
json_encode(
$this->transformer->tra... | [
"public",
"function",
"transformRequest",
"(",
"Request",
"$",
"requestIn",
",",
"Request",
"$",
"requestOut",
")",
"{",
"$",
"requestOut",
"=",
"Request",
"::",
"create",
"(",
"$",
"requestOut",
"->",
"getUri",
"(",
")",
",",
"$",
"requestOut",
"->",
"get... | Transforms a request
@param Request $requestIn The original request object
@param Request $requestOut The request object to transform
@return Request The transformed request | [
"Transforms",
"a",
"request"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/Transformation/BodyMapping.php#L64-L78 |
26,529 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/ActionUtils.php | ActionUtils.getBaseFromService | private static function getBaseFromService($service, $serviceConfig)
{
if (isset($serviceConfig[0]['router-base']) && strlen($serviceConfig[0]['router-base']) > 0) {
$base = $serviceConfig[0]['router-base'] . '/';
} else {
$parts = explode('.', $service);
$entity... | php | private static function getBaseFromService($service, $serviceConfig)
{
if (isset($serviceConfig[0]['router-base']) && strlen($serviceConfig[0]['router-base']) > 0) {
$base = $serviceConfig[0]['router-base'] . '/';
} else {
$parts = explode('.', $service);
$entity... | [
"private",
"static",
"function",
"getBaseFromService",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"serviceConfig",
"[",
"0",
"]",
"[",
"'router-base'",
"]",
")",
"&&",
"strlen",
"(",
"$",
"serviceConfig",
"[",
... | Get entity name from service strings.
By convention the last part of the service string so far
makes up the entities name.
@param string $service (partial) service id
@param array $serviceConfig service configuration
@return string | [
"Get",
"entity",
"name",
"from",
"service",
"strings",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php#L77-L91 |
26,530 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/ActionUtils.php | ActionUtils.getRouteOptions | public static function getRouteOptions($service, $serviceConfig, array $parameters = [], $useIdPattern = false)
{
if ($useIdPattern) {
$parameters['id'] = self::ID_PATTERN;
}
return self::getRoute($service, 'OPTIONS', 'optionsAction', $serviceConfig, $parameters);
} | php | public static function getRouteOptions($service, $serviceConfig, array $parameters = [], $useIdPattern = false)
{
if ($useIdPattern) {
$parameters['id'] = self::ID_PATTERN;
}
return self::getRoute($service, 'OPTIONS', 'optionsAction', $serviceConfig, $parameters);
} | [
"public",
"static",
"function",
"getRouteOptions",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"useIdPattern",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"useIdPattern",
")",
"{",
"$",
"parameter... | Get route for OPTIONS requests
@param string $service service id
@param array $serviceConfig service configuration
@param array $parameters service params
@param boolean $useIdPattern generate route with id param
@return Route | [
"Get",
"route",
"for",
"OPTIONS",
"requests"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php#L168-L174 |
26,531 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/ActionUtils.php | ActionUtils.getCanonicalSchemaRoute | public static function getCanonicalSchemaRoute($service, $serviceConfig, $type = 'item', $option = false)
{
$pattern = self::getBaseFromService($service, $serviceConfig);
$pattern = '/schema' . $pattern . $type;
$action = 'schemaAction';
$method = 'GET';
if ($option !== fals... | php | public static function getCanonicalSchemaRoute($service, $serviceConfig, $type = 'item', $option = false)
{
$pattern = self::getBaseFromService($service, $serviceConfig);
$pattern = '/schema' . $pattern . $type;
$action = 'schemaAction';
$method = 'GET';
if ($option !== fals... | [
"public",
"static",
"function",
"getCanonicalSchemaRoute",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
",",
"$",
"type",
"=",
"'item'",
",",
"$",
"option",
"=",
"false",
")",
"{",
"$",
"pattern",
"=",
"self",
"::",
"getBaseFromService",
"(",
"$",
"serv... | Get canonical route for schema requests
@param string $service service id
@param array $serviceConfig service configuration
@param string $type service type (item or collection)
@param boolean $option render a options route
@return Route | [
"Get",
"canonical",
"route",
"for",
"schema",
"requests"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php#L204-L225 |
26,532 | libgraviton/graviton | src/Graviton/I18nBundle/Service/I18nUtils.php | I18nUtils.findMatchingTranslatables | public function findMatchingTranslatables($value, $sourceLocale, $useWildCard = false)
{
// i need to use a queryBuilder as the repository doesn't let me do regex queries (i guess so..)
$builder = $this->manager->createQueryBuilder(Translation::class);
$builder
->field('language'... | php | public function findMatchingTranslatables($value, $sourceLocale, $useWildCard = false)
{
// i need to use a queryBuilder as the repository doesn't let me do regex queries (i guess so..)
$builder = $this->manager->createQueryBuilder(Translation::class);
$builder
->field('language'... | [
"public",
"function",
"findMatchingTranslatables",
"(",
"$",
"value",
",",
"$",
"sourceLocale",
",",
"$",
"useWildCard",
"=",
"false",
")",
"{",
"// i need to use a queryBuilder as the repository doesn't let me do regex queries (i guess so..)",
"$",
"builder",
"=",
"$",
"th... | This function allows to search for existing translations from a source
language, probably using a wildcard
@param string $value the translated string
@param string $sourceLocale a source locale
@param boolean $useWildCard if we should search wildcard or not
@return array matching Translatables | [
"This",
"function",
"allows",
"to",
"search",
"for",
"existing",
"translations",
"from",
"a",
"source",
"language",
"probably",
"using",
"a",
"wildcard"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/I18nBundle/Service/I18nUtils.php#L102-L133 |
26,533 | libgraviton/graviton | src/Graviton/SecurityBundle/Authentication/SecurityAuthenticator.php | SecurityAuthenticator.authenticateToken | public function authenticateToken(
TokenInterface $token,
UserProviderInterface $userProvider,
$providerKey
) {
$username = $token->getCredentials();
$roles = array_map(array($this, 'objectRolesToArray'), $token->getRoles());
$user = false;
// If no us... | php | public function authenticateToken(
TokenInterface $token,
UserProviderInterface $userProvider,
$providerKey
) {
$username = $token->getCredentials();
$roles = array_map(array($this, 'objectRolesToArray'), $token->getRoles());
$user = false;
// If no us... | [
"public",
"function",
"authenticateToken",
"(",
"TokenInterface",
"$",
"token",
",",
"UserProviderInterface",
"$",
"userProvider",
",",
"$",
"providerKey",
")",
"{",
"$",
"username",
"=",
"$",
"token",
"->",
"getCredentials",
"(",
")",
";",
"$",
"roles",
"=",
... | Tries to authenticate the provided token
@param TokenInterface $token token to authenticate
@param UserProviderInterface $userProvider provider to auth against
@param string $providerKey key to auth with
@return PreAuthenticatedToken | [
"Tries",
"to",
"authenticate",
"the",
"provided",
"token"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/SecurityBundle/Authentication/SecurityAuthenticator.php#L126-L178 |
26,534 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php | XDynamicKey.prepareFunctionNames | private static function prepareFunctionNames($refMethods)
{
$fieldNames = explode('.', $refMethods);
$getters = [];
foreach ($fieldNames as $field) {
array_push($getters, 'get'.ucfirst($field));
}
return $getters;
} | php | private static function prepareFunctionNames($refMethods)
{
$fieldNames = explode('.', $refMethods);
$getters = [];
foreach ($fieldNames as $field) {
array_push($getters, 'get'.ucfirst($field));
}
return $getters;
} | [
"private",
"static",
"function",
"prepareFunctionNames",
"(",
"$",
"refMethods",
")",
"{",
"$",
"fieldNames",
"=",
"explode",
"(",
"'.'",
",",
"$",
"refMethods",
")",
";",
"$",
"getters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fieldNames",
"as",
"$",
... | prepares getter methods for every given field name
@param string $refMethods string containing "path" to the ref field
@return array | [
"prepares",
"getter",
"methods",
"for",
"every",
"given",
"field",
"name"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator/XDynamicKey.php#L55-L65 |
26,535 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/BasicLoader.php | BasicLoader.loadService | private function loadService($service, $serviceConfig)
{
list($app, $bundle, , $entity) = explode('.', $service);
$resource = implode('.', array($app, $bundle, 'rest', $entity));
$this->loadReadOnlyRoutes($service, $resource, $serviceConfig);
if (!($serviceConfig[0] && array_key_exi... | php | private function loadService($service, $serviceConfig)
{
list($app, $bundle, , $entity) = explode('.', $service);
$resource = implode('.', array($app, $bundle, 'rest', $entity));
$this->loadReadOnlyRoutes($service, $resource, $serviceConfig);
if (!($serviceConfig[0] && array_key_exi... | [
"private",
"function",
"loadService",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
")",
"{",
"list",
"(",
"$",
"app",
",",
"$",
"bundle",
",",
",",
"$",
"entity",
")",
"=",
"explode",
"(",
"'.'",
",",
"$",
"service",
")",
";",
"$",
"resource",
"... | load routes for a single service
@param string $service service name
@param array $serviceConfig service configuration
@return void | [
"load",
"routes",
"for",
"a",
"single",
"service"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php#L88-L97 |
26,536 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/BasicLoader.php | BasicLoader.loadReadOnlyRoutes | public function loadReadOnlyRoutes($service, $resource, $serviceConfig)
{
$actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig);
$this->routes->add($resource . '.options', $actionOptions);
$actionOptionsNoSlash = ActionUtils::getRouteOptions($service, $serviceConfig);
... | php | public function loadReadOnlyRoutes($service, $resource, $serviceConfig)
{
$actionOptions = ActionUtils::getRouteOptions($service, $serviceConfig);
$this->routes->add($resource . '.options', $actionOptions);
$actionOptionsNoSlash = ActionUtils::getRouteOptions($service, $serviceConfig);
... | [
"public",
"function",
"loadReadOnlyRoutes",
"(",
"$",
"service",
",",
"$",
"resource",
",",
"$",
"serviceConfig",
")",
"{",
"$",
"actionOptions",
"=",
"ActionUtils",
"::",
"getRouteOptions",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
")",
";",
"$",
"thi... | generate ro routes
@param string $service service name
@param string $resource resource name
@param array $serviceConfig service configuration
@return void | [
"generate",
"ro",
"routes"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php#L108-L144 |
26,537 | libgraviton/graviton | src/Graviton/RestBundle/Routing/Loader/BasicLoader.php | BasicLoader.loadWriteRoutes | public function loadWriteRoutes($service, $resource, $serviceConfig)
{
$actionPost = ActionUtils::getRoutePost($service, $serviceConfig);
$this->routes->add($resource . '.post', $actionPost);
$actionPut = ActionUtils::getRoutePut($service, $serviceConfig);
$this->routes->add($resour... | php | public function loadWriteRoutes($service, $resource, $serviceConfig)
{
$actionPost = ActionUtils::getRoutePost($service, $serviceConfig);
$this->routes->add($resource . '.post', $actionPost);
$actionPut = ActionUtils::getRoutePut($service, $serviceConfig);
$this->routes->add($resour... | [
"public",
"function",
"loadWriteRoutes",
"(",
"$",
"service",
",",
"$",
"resource",
",",
"$",
"serviceConfig",
")",
"{",
"$",
"actionPost",
"=",
"ActionUtils",
"::",
"getRoutePost",
"(",
"$",
"service",
",",
"$",
"serviceConfig",
")",
";",
"$",
"this",
"->... | generate write routes
@param string $service service name
@param string $resource resource name
@param array $serviceConfig service configuration
@return void | [
"generate",
"write",
"routes"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/RestBundle/Routing/Loader/BasicLoader.php#L155-L172 |
26,538 | libgraviton/graviton | src/Graviton/GeneratorBundle/Definition/JsonDefinitionField.php | JsonDefinitionField.getTypeDoctrine | public function getTypeDoctrine()
{
if (isset(self::$doctrineTypeMap[$this->getType()])) {
return self::$doctrineTypeMap[$this->getType()];
}
// our fallback default
return self::$doctrineTypeMap[self::TYPE_STRING];
} | php | public function getTypeDoctrine()
{
if (isset(self::$doctrineTypeMap[$this->getType()])) {
return self::$doctrineTypeMap[$this->getType()];
}
// our fallback default
return self::$doctrineTypeMap[self::TYPE_STRING];
} | [
"public",
"function",
"getTypeDoctrine",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"doctrineTypeMap",
"[",
"$",
"this",
"->",
"getType",
"(",
")",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
"doctrineTypeMap",
"[",
"$",
"this",
... | Returns the field type in a doctrine-understandable way..
@return string Type | [
"Returns",
"the",
"field",
"type",
"in",
"a",
"doctrine",
"-",
"understandable",
"way",
".."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Definition/JsonDefinitionField.php#L138-L146 |
26,539 | libgraviton/graviton | src/Graviton/GeneratorBundle/Definition/JsonDefinitionField.php | JsonDefinitionField.getType | public function getType()
{
if ($this->definition->getTranslatable()) {
return self::TYPE_TRANSLATABLE;
}
return strtolower($this->definition->getType());
} | php | public function getType()
{
if ($this->definition->getTranslatable()) {
return self::TYPE_TRANSLATABLE;
}
return strtolower($this->definition->getType());
} | [
"public",
"function",
"getType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"definition",
"->",
"getTranslatable",
"(",
")",
")",
"{",
"return",
"self",
"::",
"TYPE_TRANSLATABLE",
";",
"}",
"return",
"strtolower",
"(",
"$",
"this",
"->",
"definition",
... | Returns the field type
@return string Type | [
"Returns",
"the",
"field",
"type"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Definition/JsonDefinitionField.php#L153-L159 |
26,540 | libgraviton/graviton | src/Graviton/DocumentBundle/Listener/RqlSearchNodeListener.php | RqlSearchNodeListener.onVisitNode | public function onVisitNode(VisitNodeEvent $event)
{
// any search?
if (!$event->getNode() instanceof SearchNode || $event->getNode()->isVisited()) {
return $event;
}
$this->node = $event->getNode();
$this->builder = $event->getBuilder();
$this->expr = $e... | php | public function onVisitNode(VisitNodeEvent $event)
{
// any search?
if (!$event->getNode() instanceof SearchNode || $event->getNode()->isVisited()) {
return $event;
}
$this->node = $event->getNode();
$this->builder = $event->getBuilder();
$this->expr = $e... | [
"public",
"function",
"onVisitNode",
"(",
"VisitNodeEvent",
"$",
"event",
")",
"{",
"// any search?",
"if",
"(",
"!",
"$",
"event",
"->",
"getNode",
"(",
")",
"instanceof",
"SearchNode",
"||",
"$",
"event",
"->",
"getNode",
"(",
")",
"->",
"isVisited",
"("... | gets called during the visit of a normal search node
@param VisitNodeEvent $event node event to visit
@return VisitNodeEvent event object | [
"gets",
"called",
"during",
"the",
"visit",
"of",
"a",
"normal",
"search",
"node"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Listener/RqlSearchNodeListener.php#L89-L113 |
26,541 | libgraviton/graviton | src/Graviton/DocumentBundle/Listener/RqlSearchNodeListener.php | RqlSearchNodeListener.getSearchMode | private function getSearchMode()
{
$this->solrQuery->setClassName($this->className);
if ($this->solrQuery->isConfigured()) {
return self::SEARCHMODE_SOLR;
}
return self::SEARCHMODE_MONGO;
} | php | private function getSearchMode()
{
$this->solrQuery->setClassName($this->className);
if ($this->solrQuery->isConfigured()) {
return self::SEARCHMODE_SOLR;
}
return self::SEARCHMODE_MONGO;
} | [
"private",
"function",
"getSearchMode",
"(",
")",
"{",
"$",
"this",
"->",
"solrQuery",
"->",
"setClassName",
"(",
"$",
"this",
"->",
"className",
")",
";",
"if",
"(",
"$",
"this",
"->",
"solrQuery",
"->",
"isConfigured",
"(",
")",
")",
"{",
"return",
"... | returns which search backend to use
@return string search mode constant | [
"returns",
"which",
"search",
"backend",
"to",
"use"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/Listener/RqlSearchNodeListener.php#L211-L219 |
26,542 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/BundleGenerator.php | BundleGenerator.generate | public function generate($namespace, $bundle, $dir, $format)
{
$dir .= '/' . strtr($namespace, '\\', '/');
// make sure we have no trailing \ in namespace
if (substr($namespace, -1) == '\\') {
$namespace = substr($namespace, 0, -1);
}
$basename = $this->getBundl... | php | public function generate($namespace, $bundle, $dir, $format)
{
$dir .= '/' . strtr($namespace, '\\', '/');
// make sure we have no trailing \ in namespace
if (substr($namespace, -1) == '\\') {
$namespace = substr($namespace, 0, -1);
}
$basename = $this->getBundl... | [
"public",
"function",
"generate",
"(",
"$",
"namespace",
",",
"$",
"bundle",
",",
"$",
"dir",
",",
"$",
"format",
")",
"{",
"$",
"dir",
".=",
"'/'",
".",
"strtr",
"(",
"$",
"namespace",
",",
"'\\\\'",
",",
"'/'",
")",
";",
"// make sure we have no trai... | generate bundle code
@param string $namespace namspace name
@param string $bundle bundle name
@param string $dir bundle dir
@param string $format bundle condfig file format
@return void | [
"generate",
"bundle",
"code"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/BundleGenerator.php#L35-L79 |
26,543 | libgraviton/graviton | src/Graviton/DocumentBundle/DependencyInjection/Compiler/SolrDefinitionCompilerPass.php | SolrDefinitionCompilerPass.process | public function process(ContainerBuilder $container)
{
$this->documentMap = $container->get('graviton.document.map');
$map = [];
foreach ($this->documentMap->getDocuments() as $document) {
$solrFields = $document->getSolrFields();
if (is_array($solrFields) && !empty(... | php | public function process(ContainerBuilder $container)
{
$this->documentMap = $container->get('graviton.document.map');
$map = [];
foreach ($this->documentMap->getDocuments() as $document) {
$solrFields = $document->getSolrFields();
if (is_array($solrFields) && !empty(... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"documentMap",
"=",
"$",
"container",
"->",
"get",
"(",
"'graviton.document.map'",
")",
";",
"$",
"map",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"th... | map with the weight string incorporated
@param ContainerBuilder $container container builder
@return void | [
"map",
"with",
"the",
"weight",
"string",
"incorporated"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/DependencyInjection/Compiler/SolrDefinitionCompilerPass.php#L30-L43 |
26,544 | libgraviton/graviton | src/Graviton/DocumentBundle/DependencyInjection/Compiler/SolrDefinitionCompilerPass.php | SolrDefinitionCompilerPass.getSolrWeightString | private function getSolrWeightString(array $solrFields)
{
$weights = [];
foreach ($solrFields as $field) {
$weights[] = $field['name'].'^'.$field['weight'];
}
return implode(' ', $weights);
} | php | private function getSolrWeightString(array $solrFields)
{
$weights = [];
foreach ($solrFields as $field) {
$weights[] = $field['name'].'^'.$field['weight'];
}
return implode(' ', $weights);
} | [
"private",
"function",
"getSolrWeightString",
"(",
"array",
"$",
"solrFields",
")",
"{",
"$",
"weights",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"solrFields",
"as",
"$",
"field",
")",
"{",
"$",
"weights",
"[",
"]",
"=",
"$",
"field",
"[",
"'name'",
... | Returns the solr weight string
@param array $solrFields fields
@return string weight string | [
"Returns",
"the",
"solr",
"weight",
"string"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/DocumentBundle/DependencyInjection/Compiler/SolrDefinitionCompilerPass.php#L52-L60 |
26,545 | libgraviton/graviton | src/Graviton/CoreBundle/Listener/RequestHostListener.php | RequestHostListener.onKernelRequest | public function onKernelRequest()
{
if (!is_null($this->host)) {
$this->router->getContext()->setHost($this->host);
}
if (!is_null($this->portHttp)) {
$this->router->getContext()->setHttpPort($this->portHttp);
}
if (!is_null($this->portHttps)) {
... | php | public function onKernelRequest()
{
if (!is_null($this->host)) {
$this->router->getContext()->setHost($this->host);
}
if (!is_null($this->portHttp)) {
$this->router->getContext()->setHttpPort($this->portHttp);
}
if (!is_null($this->portHttps)) {
... | [
"public",
"function",
"onKernelRequest",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"host",
")",
")",
"{",
"$",
"this",
"->",
"router",
"->",
"getContext",
"(",
")",
"->",
"setHost",
"(",
"$",
"this",
"->",
"host",
")",
";",
... | modify the router context params if configured
@return void | [
"modify",
"the",
"router",
"context",
"params",
"if",
"configured"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/CoreBundle/Listener/RequestHostListener.php#L68-L81 |
26,546 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generate | public function generate(
$bundleDir,
$bundleNamespace,
$bundleName,
$document
) {
$this->readServicesAndParams($bundleDir);
$basename = $this->getBundleBaseName($document);
if (!is_null($this->json)) {
$this->json->setNamespace($bundleNamespace)... | php | public function generate(
$bundleDir,
$bundleNamespace,
$bundleName,
$document
) {
$this->readServicesAndParams($bundleDir);
$basename = $this->getBundleBaseName($document);
if (!is_null($this->json)) {
$this->json->setNamespace($bundleNamespace)... | [
"public",
"function",
"generate",
"(",
"$",
"bundleDir",
",",
"$",
"bundleNamespace",
",",
"$",
"bundleName",
",",
"$",
"document",
")",
"{",
"$",
"this",
"->",
"readServicesAndParams",
"(",
"$",
"bundleDir",
")",
";",
"$",
"basename",
"=",
"$",
"this",
... | generate the resource with all its bits and parts
@param string $bundleDir bundle dir
@param string $bundleNamespace bundle namespace
@param string $bundleName bundle name
@param string $document document name
@return void | [
"generate",
"the",
"resource",
"with",
"all",
"its",
"bits",
"and",
"parts"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L123-L177 |
26,547 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.readServicesAndParams | protected function readServicesAndParams($bundleDir)
{
$this->servicesFile = $bundleDir.'/Resources/config/services.yml';
if ($this->fs->exists($this->servicesFile)) {
$this->services = Yaml::parseFile($this->servicesFile);
}
if (!isset($this->services['services'])) {
... | php | protected function readServicesAndParams($bundleDir)
{
$this->servicesFile = $bundleDir.'/Resources/config/services.yml';
if ($this->fs->exists($this->servicesFile)) {
$this->services = Yaml::parseFile($this->servicesFile);
}
if (!isset($this->services['services'])) {
... | [
"protected",
"function",
"readServicesAndParams",
"(",
"$",
"bundleDir",
")",
"{",
"$",
"this",
"->",
"servicesFile",
"=",
"$",
"bundleDir",
".",
"'/Resources/config/services.yml'",
";",
"if",
"(",
"$",
"this",
"->",
"fs",
"->",
"exists",
"(",
"$",
"this",
"... | reads the services.yml file
@param string $bundleDir bundle dir
@return void | [
"reads",
"the",
"services",
".",
"yml",
"file"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L186-L203 |
26,548 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.persistServicesAndParams | protected function persistServicesAndParams()
{
$this->filesystem->dumpFile(
$this->servicesFile,
Yaml::dump(array_merge($this->parameters, $this->services))
);
} | php | protected function persistServicesAndParams()
{
$this->filesystem->dumpFile(
$this->servicesFile,
Yaml::dump(array_merge($this->parameters, $this->services))
);
} | [
"protected",
"function",
"persistServicesAndParams",
"(",
")",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"dumpFile",
"(",
"$",
"this",
"->",
"servicesFile",
",",
"Yaml",
"::",
"dump",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"parameters",
",",
"$",
"t... | writes the services.yml file which includes the params
@return void | [
"writes",
"the",
"services",
".",
"yml",
"file",
"which",
"includes",
"the",
"params"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L210-L216 |
26,549 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generateDocument | protected function generateDocument($parameters, $dir, $document)
{
// doctrine mapping normal class
$this->renderFile(
'document/Document.mongodb.yml.twig',
$dir . '/Resources/config/doctrine/' . $document . '.mongodb.yml',
$parameters
);
// doct... | php | protected function generateDocument($parameters, $dir, $document)
{
// doctrine mapping normal class
$this->renderFile(
'document/Document.mongodb.yml.twig',
$dir . '/Resources/config/doctrine/' . $document . '.mongodb.yml',
$parameters
);
// doct... | [
"protected",
"function",
"generateDocument",
"(",
"$",
"parameters",
",",
"$",
"dir",
",",
"$",
"document",
")",
"{",
"// doctrine mapping normal class",
"$",
"this",
"->",
"renderFile",
"(",
"'document/Document.mongodb.yml.twig'",
",",
"$",
"dir",
".",
"'/Resources... | generate document part of a resource
@param array $parameters twig parameters
@param string $dir base bundle dir
@param string $document document name
@return void | [
"generate",
"document",
"part",
"of",
"a",
"resource"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L227-L266 |
26,550 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generateServices | protected function generateServices($parameters, $dir, $document)
{
$bundleParts = explode('\\', $parameters['base']);
$shortName = $bundleParts[0];
$shortBundle = $this->getBundleBaseName($bundleParts[1]);
$docName = implode(
'.',
array(
strt... | php | protected function generateServices($parameters, $dir, $document)
{
$bundleParts = explode('\\', $parameters['base']);
$shortName = $bundleParts[0];
$shortBundle = $this->getBundleBaseName($bundleParts[1]);
$docName = implode(
'.',
array(
strt... | [
"protected",
"function",
"generateServices",
"(",
"$",
"parameters",
",",
"$",
"dir",
",",
"$",
"document",
")",
"{",
"$",
"bundleParts",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"parameters",
"[",
"'base'",
"]",
")",
";",
"$",
"shortName",
"=",
"$",
"... | update xml services
@param array $parameters twig parameters
@param string $dir base bundle dir
@param string $document document name
@return void | [
"update",
"xml",
"services"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L277-L355 |
26,551 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.addService | protected function addService(
$id,
$parent = null,
array $calls = [],
$tag = null,
array $arguments = [],
$factoryService = null,
$factoryMethod = null,
$className = null
) {
$service = [];
$service['public'] = true;
// classn... | php | protected function addService(
$id,
$parent = null,
array $calls = [],
$tag = null,
array $arguments = [],
$factoryService = null,
$factoryMethod = null,
$className = null
) {
$service = [];
$service['public'] = true;
// classn... | [
"protected",
"function",
"addService",
"(",
"$",
"id",
",",
"$",
"parent",
"=",
"null",
",",
"array",
"$",
"calls",
"=",
"[",
"]",
",",
"$",
"tag",
"=",
"null",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
",",
"$",
"factoryService",
"=",
"null",... | add service to services.yml
@param string $id id of new service
@param string $parent parent for service
@param array $calls methodCalls to add
@param string $tag tag name or empty if no tag needed
@param array $arguments service arguments
@param string $factoryService fa... | [
"add",
"service",
"to",
"services",
".",
"yml"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L385-L458 |
26,552 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generateSerializer | protected function generateSerializer(array $parameters, $dir, $document)
{
// @TODO in Embedded and document just render the differences..
$this->renderFile(
'serializer/Document.xml.twig',
$dir . '/Resources/config/serializer/Document.' . $document . 'Embedded.xml',
... | php | protected function generateSerializer(array $parameters, $dir, $document)
{
// @TODO in Embedded and document just render the differences..
$this->renderFile(
'serializer/Document.xml.twig',
$dir . '/Resources/config/serializer/Document.' . $document . 'Embedded.xml',
... | [
"protected",
"function",
"generateSerializer",
"(",
"array",
"$",
"parameters",
",",
"$",
"dir",
",",
"$",
"document",
")",
"{",
"// @TODO in Embedded and document just render the differences..",
"$",
"this",
"->",
"renderFile",
"(",
"'serializer/Document.xml.twig'",
",",... | generate serializer part of a resource
@param array $parameters twig parameters
@param string $dir base bundle dir
@param string $document document name
@return void | [
"generate",
"serializer",
"part",
"of",
"a",
"resource"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L469-L519 |
26,553 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generateModel | protected function generateModel(array $parameters, $dir, $document)
{
$this->renderFile(
'model/Model.php.twig',
$dir . '/Model/' . $document . '.php',
$parameters
);
$this->renderFile(
'model/schema.json.twig',
$dir . '/Resources/... | php | protected function generateModel(array $parameters, $dir, $document)
{
$this->renderFile(
'model/Model.php.twig',
$dir . '/Model/' . $document . '.php',
$parameters
);
$this->renderFile(
'model/schema.json.twig',
$dir . '/Resources/... | [
"protected",
"function",
"generateModel",
"(",
"array",
"$",
"parameters",
",",
"$",
"dir",
",",
"$",
"document",
")",
"{",
"$",
"this",
"->",
"renderFile",
"(",
"'model/Model.php.twig'",
",",
"$",
"dir",
".",
"'/Model/'",
".",
"$",
"document",
".",
"'.php... | generate model part of a resource
@param array $parameters twig parameters
@param string $dir base bundle dir
@param string $document document name
@return void | [
"generate",
"model",
"part",
"of",
"a",
"resource"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L530-L593 |
26,554 | libgraviton/graviton | src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php | ResourceGenerator.generateController | protected function generateController(array $parameters, $dir, $document)
{
$this->renderFile(
'controller/DocumentController.php.twig',
$dir . '/Controller/' . $document . 'Controller.php',
$parameters
);
$bundleParts = explode('\\', $parameters['base'])... | php | protected function generateController(array $parameters, $dir, $document)
{
$this->renderFile(
'controller/DocumentController.php.twig',
$dir . '/Controller/' . $document . 'Controller.php',
$parameters
);
$bundleParts = explode('\\', $parameters['base'])... | [
"protected",
"function",
"generateController",
"(",
"array",
"$",
"parameters",
",",
"$",
"dir",
",",
"$",
"document",
")",
"{",
"$",
"this",
"->",
"renderFile",
"(",
"'controller/DocumentController.php.twig'",
",",
"$",
"dir",
".",
"'/Controller/'",
".",
"$",
... | generate RESTful controllers ans service configs
@param array $parameters twig parameters
@param string $dir base bundle dir
@param string $document document name
@return void | [
"generate",
"RESTful",
"controllers",
"ans",
"service",
"configs"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/GeneratorBundle/Generator/ResourceGenerator.php#L604-L636 |
26,555 | libgraviton/graviton | src/Graviton/CoreBundle/Listener/JsonExceptionListener.php | JsonExceptionListener.onKernelException | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
// Should return a error 400 bad request
if ($exception instanceof ValidationException
|| $exception instanceof SyntaxErrorException) {
return;
}
... | php | public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
// Should return a error 400 bad request
if ($exception instanceof ValidationException
|| $exception instanceof SyntaxErrorException) {
return;
}
... | [
"public",
"function",
"onKernelException",
"(",
"GetResponseForExceptionEvent",
"$",
"event",
")",
"{",
"$",
"exception",
"=",
"$",
"event",
"->",
"getException",
"(",
")",
";",
"// Should return a error 400 bad request",
"if",
"(",
"$",
"exception",
"instanceof",
"... | Should not handle Validation Exceptions and only service exceptions
@param GetResponseForExceptionEvent $event Sf Event
@return void | [
"Should",
"not",
"handle",
"Validation",
"Exceptions",
"and",
"only",
"service",
"exceptions"
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/CoreBundle/Listener/JsonExceptionListener.php#L49-L85 |
26,556 | libgraviton/graviton | src/Graviton/CoreBundle/Listener/JsonExceptionListener.php | JsonExceptionListener.decorateKnownCases | private function decorateKnownCases($exception)
{
if (
$exception instanceof \ErrorException &&
strpos($exception->getMessage(), 'Undefined index: $id') !== false
) {
return [
'code' => $exception->getCode(),
'message' => 'An incomp... | php | private function decorateKnownCases($exception)
{
if (
$exception instanceof \ErrorException &&
strpos($exception->getMessage(), 'Undefined index: $id') !== false
) {
return [
'code' => $exception->getCode(),
'message' => 'An incomp... | [
"private",
"function",
"decorateKnownCases",
"(",
"$",
"exception",
")",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"\\",
"ErrorException",
"&&",
"strpos",
"(",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"'Undefined index: $id'",
")",
"!==",
"fa... | Here we can pick up known cases that can happen and render a more detailed error message for the client.
It may be cumbersome, but it's good to detail error messages then just to let general error messages
generate support issues and work for us.
@param \Exception $exception exception
@return array|null either a erro... | [
"Here",
"we",
"can",
"pick",
"up",
"known",
"cases",
"that",
"can",
"happen",
"and",
"render",
"a",
"more",
"detailed",
"error",
"message",
"for",
"the",
"client",
".",
"It",
"may",
"be",
"cumbersome",
"but",
"it",
"s",
"good",
"to",
"detail",
"error",
... | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/CoreBundle/Listener/JsonExceptionListener.php#L96-L126 |
26,557 | libgraviton/graviton | src/Graviton/ProxyBundle/DependencyInjection/GravitonProxyExtension.php | GravitonProxyExtension.load | public function load(array $configs, ContainerBuilder $container)
{
parent::load($configs, $container);
$configs = $this->processConfiguration(new Configuration(), $configs);
$sources = $container->hasParameter('graviton.proxy.sources') ?
$container->getParameter('graviton.prox... | php | public function load(array $configs, ContainerBuilder $container)
{
parent::load($configs, $container);
$configs = $this->processConfiguration(new Configuration(), $configs);
$sources = $container->hasParameter('graviton.proxy.sources') ?
$container->getParameter('graviton.prox... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"parent",
"::",
"load",
"(",
"$",
"configs",
",",
"$",
"container",
")",
";",
"$",
"configs",
"=",
"$",
"this",
"->",
"processConfiguration",
... | Loads current configuration.
@param array $configs Set of configuration options
@param ContainerBuilder $container Instance of the SF2 container
@return void | [
"Loads",
"current",
"configuration",
"."
] | 5eccfb2fba31dadf659f0f55edeb1ebca403563e | https://github.com/libgraviton/graviton/blob/5eccfb2fba31dadf659f0f55edeb1ebca403563e/src/Graviton/ProxyBundle/DependencyInjection/GravitonProxyExtension.php#L40-L50 |
26,558 | iherwig/wcmf | src/wcmf/lib/presentation/format/impl/HierarchicalFormat.php | HierarchicalFormat.deserializeHierarchy | private function deserializeHierarchy($values) {
if ($this->isSerializedNode($values)) {
// the values represent a node
$result = $this->deserializeNode($values);
$node = $result['node'];
$values = $result['data'];
$values[$node->getOID()->__toString()] = $node;
}
else {
... | php | private function deserializeHierarchy($values) {
if ($this->isSerializedNode($values)) {
// the values represent a node
$result = $this->deserializeNode($values);
$node = $result['node'];
$values = $result['data'];
$values[$node->getOID()->__toString()] = $node;
}
else {
... | [
"private",
"function",
"deserializeHierarchy",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSerializedNode",
"(",
"$",
"values",
")",
")",
"{",
"// the values represent a node",
"$",
"result",
"=",
"$",
"this",
"->",
"deserializeNode",
"(",
... | Deserialize the given values recursively
@param $values
@return Array | [
"Deserialize",
"the",
"given",
"values",
"recursively"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/format/impl/HierarchicalFormat.php#L48-L78 |
26,559 | iherwig/wcmf | src/wcmf/lib/presentation/format/impl/HierarchicalFormat.php | HierarchicalFormat.serializeHierarchy | private function serializeHierarchy($values) {
if ($this->isDeserializedNode($values)) {
// the values represent a node
$values = $this->serializeNode($values);
}
else {
if (is_array($values) || ($values instanceof \Traversable)) {
foreach ($values as $key => $value) {
if... | php | private function serializeHierarchy($values) {
if ($this->isDeserializedNode($values)) {
// the values represent a node
$values = $this->serializeNode($values);
}
else {
if (is_array($values) || ($values instanceof \Traversable)) {
foreach ($values as $key => $value) {
if... | [
"private",
"function",
"serializeHierarchy",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDeserializedNode",
"(",
"$",
"values",
")",
")",
"{",
"// the values represent a node",
"$",
"values",
"=",
"$",
"this",
"->",
"serializeNode",
"(",
"... | Serialize the given values recursively
@param $values
@return Array | [
"Serialize",
"the",
"given",
"values",
"recursively"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/format/impl/HierarchicalFormat.php#L85-L111 |
26,560 | skie/plum_search | src/FormParameter/SelectParameter.php | SelectParameter.formInputConfig | public function formInputConfig()
{
$formConfig = parent::formInputConfig();
if (!array_key_exists('options', $formConfig)) {
$options = $this->config('options');
$finder = $this->config('finder');
if (!empty($options) && is_array($options)) {
$fo... | php | public function formInputConfig()
{
$formConfig = parent::formInputConfig();
if (!array_key_exists('options', $formConfig)) {
$options = $this->config('options');
$finder = $this->config('finder');
if (!empty($options) && is_array($options)) {
$fo... | [
"public",
"function",
"formInputConfig",
"(",
")",
"{",
"$",
"formConfig",
"=",
"parent",
"::",
"formInputConfig",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"'options'",
",",
"$",
"formConfig",
")",
")",
"{",
"$",
"options",
"=",
"$",
"this... | Returns input config
@return array | [
"Returns",
"input",
"config"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/SelectParameter.php#L74-L90 |
26,561 | skie/plum_search | src/FormParameter/SelectParameter.php | SelectParameter._allowedEmptyOptions | protected function _allowedEmptyOptions()
{
$options = $this->config('options');
$allowEmptyOptions = $this->config('allowEmptyOptions');
return is_array($options) && !empty($allowEmptyOptions);
} | php | protected function _allowedEmptyOptions()
{
$options = $this->config('options');
$allowEmptyOptions = $this->config('allowEmptyOptions');
return is_array($options) && !empty($allowEmptyOptions);
} | [
"protected",
"function",
"_allowedEmptyOptions",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"config",
"(",
"'options'",
")",
";",
"$",
"allowEmptyOptions",
"=",
"$",
"this",
"->",
"config",
"(",
"'allowEmptyOptions'",
")",
";",
"return",
"is_arra... | Check if empty options allowed
@return bool | [
"Check",
"if",
"empty",
"options",
"allowed"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/SelectParameter.php#L97-L103 |
26,562 | iherwig/wcmf | src/wcmf/lib/util/I18nUtil.php | I18nUtil.getMessages | public static function getMessages($directory, $exclude, $pattern, $depth=0) {
if ($depth == 0) {
self::$baseDir = $directory;
}
if (substr($directory, -1) != '/') {
$directory .= '/';
}
if (is_dir($directory)) {
$d = dir($directory);
$d->rewind();
while(false !== ($fi... | php | public static function getMessages($directory, $exclude, $pattern, $depth=0) {
if ($depth == 0) {
self::$baseDir = $directory;
}
if (substr($directory, -1) != '/') {
$directory .= '/';
}
if (is_dir($directory)) {
$d = dir($directory);
$d->rewind();
while(false !== ($fi... | [
"public",
"static",
"function",
"getMessages",
"(",
"$",
"directory",
",",
"$",
"exclude",
",",
"$",
"pattern",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"depth",
"==",
"0",
")",
"{",
"self",
"::",
"$",
"baseDir",
"=",
"$",
"directory"... | Get all messages from a directory recursively.
@param $directory The directory to search in
@param $exclude Array of directory names that are excluded from search
@param $pattern The pattern the names of the files to search in must match
@param $depth Internal use only
@return An assoziative array with the filenames as... | [
"Get",
"all",
"messages",
"from",
"a",
"directory",
"recursively",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/I18nUtil.php#L37-L68 |
26,563 | iherwig/wcmf | src/wcmf/lib/util/I18nUtil.php | I18nUtil.createPHPLanguageFile | public static function createPHPLanguageFile($language, $messages) {
$fileUtil = new FileUtil();
// get locale directory
$config = ObjectFactory::getInstance('configuration');
$localeDir = $config->getDirectoryValue('localeDir', 'application');
$fileUtil->mkdirRec($localeDir);
$file = $localeDi... | php | public static function createPHPLanguageFile($language, $messages) {
$fileUtil = new FileUtil();
// get locale directory
$config = ObjectFactory::getInstance('configuration');
$localeDir = $config->getDirectoryValue('localeDir', 'application');
$fileUtil->mkdirRec($localeDir);
$file = $localeDi... | [
"public",
"static",
"function",
"createPHPLanguageFile",
"(",
"$",
"language",
",",
"$",
"messages",
")",
"{",
"$",
"fileUtil",
"=",
"new",
"FileUtil",
"(",
")",
";",
"// get locale directory",
"$",
"config",
"=",
"ObjectFactory",
"::",
"getInstance",
"(",
"'c... | Create a message file for use with the Message class. The file will
be created in the directory defined in configutation key 'localeDir' in
'application' section.
@param $language The language of the file (language code e.g. 'de')
@param $messages An assoziative array with the messages as keys
and assoziative array wit... | [
"Create",
"a",
"message",
"file",
"for",
"use",
"with",
"the",
"Message",
"class",
".",
"The",
"file",
"will",
"be",
"created",
"in",
"the",
"directory",
"defined",
"in",
"configutation",
"key",
"localeDir",
"in",
"application",
"section",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/util/I18nUtil.php#L118-L155 |
26,564 | vufind-org/vufindharvest | src/ResponseProcessor/SimpleXmlResponseProcessor.php | SimpleXmlResponseProcessor.logBadXML | protected function logBadXML($xml)
{
$file = @fopen($this->badXmlLog, 'a');
if (!$file) {
throw new \Exception("Problem opening {$this->badXmlLog}.");
}
fputs($file, $xml . "\n\n");
fclose($file);
} | php | protected function logBadXML($xml)
{
$file = @fopen($this->badXmlLog, 'a');
if (!$file) {
throw new \Exception("Problem opening {$this->badXmlLog}.");
}
fputs($file, $xml . "\n\n");
fclose($file);
} | [
"protected",
"function",
"logBadXML",
"(",
"$",
"xml",
")",
"{",
"$",
"file",
"=",
"@",
"fopen",
"(",
"$",
"this",
"->",
"badXmlLog",
",",
"'a'",
")",
";",
"if",
"(",
"!",
"$",
"file",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Problem op... | Log a bad XML response.
@param string $xml Bad XML
@return void | [
"Log",
"a",
"bad",
"XML",
"response",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/ResponseProcessor/SimpleXmlResponseProcessor.php#L84-L92 |
26,565 | vufind-org/vufindharvest | src/ResponseProcessor/SimpleXmlResponseProcessor.php | SimpleXmlResponseProcessor.sanitizeXml | protected function sanitizeXml($xml)
{
// Sanitize the XML if requested:
$newXML = trim(preg_replace($this->sanitizeRegex, ' ', $xml, -1, $count));
if ($count > 0 && $this->badXmlLog) {
$this->logBadXML($xml);
}
return $newXML;
} | php | protected function sanitizeXml($xml)
{
// Sanitize the XML if requested:
$newXML = trim(preg_replace($this->sanitizeRegex, ' ', $xml, -1, $count));
if ($count > 0 && $this->badXmlLog) {
$this->logBadXML($xml);
}
return $newXML;
} | [
"protected",
"function",
"sanitizeXml",
"(",
"$",
"xml",
")",
"{",
"// Sanitize the XML if requested:",
"$",
"newXML",
"=",
"trim",
"(",
"preg_replace",
"(",
"$",
"this",
"->",
"sanitizeRegex",
",",
"' '",
",",
"$",
"xml",
",",
"-",
"1",
",",
"$",
"count",... | Sanitize XML.
@param string $xml XML to sanitize
@return string | [
"Sanitize",
"XML",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/ResponseProcessor/SimpleXmlResponseProcessor.php#L101-L111 |
26,566 | vufind-org/vufindharvest | src/ResponseProcessor/SimpleXmlResponseProcessor.php | SimpleXmlResponseProcessor.collectXmlErrors | protected function collectXmlErrors()
{
$callback = function ($e) {
return trim($e->message);
};
return implode('; ', array_map($callback, libxml_get_errors()));
} | php | protected function collectXmlErrors()
{
$callback = function ($e) {
return trim($e->message);
};
return implode('; ', array_map($callback, libxml_get_errors()));
} | [
"protected",
"function",
"collectXmlErrors",
"(",
")",
"{",
"$",
"callback",
"=",
"function",
"(",
"$",
"e",
")",
"{",
"return",
"trim",
"(",
"$",
"e",
"->",
"message",
")",
";",
"}",
";",
"return",
"implode",
"(",
"'; '",
",",
"array_map",
"(",
"$",... | Collect LibXML errors into a single string.
@return string | [
"Collect",
"LibXML",
"errors",
"into",
"a",
"single",
"string",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/ResponseProcessor/SimpleXmlResponseProcessor.php#L118-L124 |
26,567 | vufind-org/vufindharvest | src/ResponseProcessor/SimpleXmlResponseProcessor.php | SimpleXmlResponseProcessor.process | public function process($xml)
{
// Sanitize if necessary:
if ($this->sanitize) {
$xml = $this->sanitizeXml($xml);
}
// Parse the XML (newer versions of LibXML require a special flag for
// large documents, and responses may be quite large):
$flags = LIBXM... | php | public function process($xml)
{
// Sanitize if necessary:
if ($this->sanitize) {
$xml = $this->sanitizeXml($xml);
}
// Parse the XML (newer versions of LibXML require a special flag for
// large documents, and responses may be quite large):
$flags = LIBXM... | [
"public",
"function",
"process",
"(",
"$",
"xml",
")",
"{",
"// Sanitize if necessary:",
"if",
"(",
"$",
"this",
"->",
"sanitize",
")",
"{",
"$",
"xml",
"=",
"$",
"this",
"->",
"sanitizeXml",
"(",
"$",
"xml",
")",
";",
"}",
"// Parse the XML (newer version... | Process an OAI-PMH response into a SimpleXML object. Throw an exception if
an error is detected.
@param string $xml Raw XML to process
@return mixed
@throws \Exception | [
"Process",
"an",
"OAI",
"-",
"PMH",
"response",
"into",
"a",
"SimpleXML",
"object",
".",
"Throw",
"an",
"exception",
"if",
"an",
"error",
"is",
"detected",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/ResponseProcessor/SimpleXmlResponseProcessor.php#L136-L156 |
26,568 | iherwig/wcmf | src/wcmf/lib/model/PersistentIterator.php | PersistentIterator.save | public function save() {
$state = ['end' => $this->end, 'oidList' => $this->oidList, 'processedOidList' => $this->processedOidList,
'currentOID' => $this->currentOid, 'currentDepth' => $this->currentDepth, 'aggregationKinds' => $this->aggregationKinds];
$this->session->set($this->id, $state);
} | php | public function save() {
$state = ['end' => $this->end, 'oidList' => $this->oidList, 'processedOidList' => $this->processedOidList,
'currentOID' => $this->currentOid, 'currentDepth' => $this->currentDepth, 'aggregationKinds' => $this->aggregationKinds];
$this->session->set($this->id, $state);
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"state",
"=",
"[",
"'end'",
"=>",
"$",
"this",
"->",
"end",
",",
"'oidList'",
"=>",
"$",
"this",
"->",
"oidList",
",",
"'processedOidList'",
"=>",
"$",
"this",
"->",
"processedOidList",
",",
"'currentOID'... | Save the iterator state to the session | [
"Save",
"the",
"iterator",
"state",
"to",
"the",
"session"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/PersistentIterator.php#L68-L72 |
26,569 | iherwig/wcmf | src/wcmf/lib/model/PersistentIterator.php | PersistentIterator.load | public static function load($id, $persistenceFacade, $session) {
// get state from session
$state = $session->get($id);
if ($state == null) {
return null;
}
// create instance
$instance = new PersistentIterator($id, $persistenceFacade, $session,
$state['currentOID']);
$inst... | php | public static function load($id, $persistenceFacade, $session) {
// get state from session
$state = $session->get($id);
if ($state == null) {
return null;
}
// create instance
$instance = new PersistentIterator($id, $persistenceFacade, $session,
$state['currentOID']);
$inst... | [
"public",
"static",
"function",
"load",
"(",
"$",
"id",
",",
"$",
"persistenceFacade",
",",
"$",
"session",
")",
"{",
"// get state from session",
"$",
"state",
"=",
"$",
"session",
"->",
"get",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"state",
"==",
... | Load an iterator state from the session
@param $id The unique iterator id used to store iterator's the state in the session
@param $persistenceFacade
@param $session
@return PersistentIterator instance holding the saved state or null if unique id is not found | [
"Load",
"an",
"iterator",
"state",
"from",
"the",
"session"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/PersistentIterator.php#L90-L105 |
26,570 | iherwig/wcmf | src/wcmf/lib/model/PersistentIterator.php | PersistentIterator.addToQueue | protected function addToQueue($oidList, $depth) {
for ($i=sizeOf($oidList)-1; $i>=0; $i--) {
$this->oidList[] = [$oidList[$i], $depth];
}
} | php | protected function addToQueue($oidList, $depth) {
for ($i=sizeOf($oidList)-1; $i>=0; $i--) {
$this->oidList[] = [$oidList[$i], $depth];
}
} | [
"protected",
"function",
"addToQueue",
"(",
"$",
"oidList",
",",
"$",
"depth",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"sizeOf",
"(",
"$",
"oidList",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"$",
"this",
"->",
"oid... | Add object ids to the processing queue.
@param $oidList An array of object ids.
@param $depth The depth of the object ids in the tree. | [
"Add",
"object",
"ids",
"to",
"the",
"processing",
"queue",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/PersistentIterator.php#L196-L200 |
26,571 | GW2Treasures/gw2api | src/V2/Bulk/BulkEndpoint.php | BulkEndpoint.many | public function many( array $ids = [] ) {
if( count( $ids ) === 0 ) {
return [];
}
$pages = array_chunk( $ids, $this->maxPageSize() );
$requests = [];
foreach( $pages as $page ) {
$requests[] = [ 'ids' => implode( ',', $page ) ];
}
$resp... | php | public function many( array $ids = [] ) {
if( count( $ids ) === 0 ) {
return [];
}
$pages = array_chunk( $ids, $this->maxPageSize() );
$requests = [];
foreach( $pages as $page ) {
$requests[] = [ 'ids' => implode( ',', $page ) ];
}
$resp... | [
"public",
"function",
"many",
"(",
"array",
"$",
"ids",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"ids",
")",
"===",
"0",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"pages",
"=",
"array_chunk",
"(",
"$",
"ids",
",",
"$",
"this"... | Multiple entries by ids.
@param string[]|int[] $ids
@return array | [
"Multiple",
"entries",
"by",
"ids",
"."
] | c8795af0c1d0a434b9e530f779d5a95786db2176 | https://github.com/GW2Treasures/gw2api/blob/c8795af0c1d0a434b9e530f779d5a95786db2176/src/V2/Bulk/BulkEndpoint.php#L48-L68 |
26,572 | vufind-org/vufindharvest | src/OaiPmh/Harvester.php | Harvester.launch | public function launch()
{
// Normalize sets setting to an array:
$sets = (array)$this->set;
if (empty($sets)) {
$sets = [null];
}
// Load last state, if applicable (used to recover from server failure).
if ($state = $this->stateManager->loadState()) {
... | php | public function launch()
{
// Normalize sets setting to an array:
$sets = (array)$this->set;
if (empty($sets)) {
$sets = [null];
}
// Load last state, if applicable (used to recover from server failure).
if ($state = $this->stateManager->loadState()) {
... | [
"public",
"function",
"launch",
"(",
")",
"{",
"// Normalize sets setting to an array:",
"$",
"sets",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"set",
";",
"if",
"(",
"empty",
"(",
"$",
"sets",
")",
")",
"{",
"$",
"sets",
"=",
"[",
"null",
"]",
";",... | Harvest all available documents.
@return void | [
"Harvest",
"all",
"available",
"documents",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Harvester.php#L159-L202 |
26,573 | vufind-org/vufindharvest | src/OaiPmh/Harvester.php | Harvester.loadGranularity | protected function loadGranularity()
{
$this->write("Autodetecting date granularity... ");
$response = $this->sendRequest('Identify');
$this->granularity = (string)$response->Identify->granularity;
$this->writeLine("found {$this->granularity}.");
} | php | protected function loadGranularity()
{
$this->write("Autodetecting date granularity... ");
$response = $this->sendRequest('Identify');
$this->granularity = (string)$response->Identify->granularity;
$this->writeLine("found {$this->granularity}.");
} | [
"protected",
"function",
"loadGranularity",
"(",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"\"Autodetecting date granularity... \"",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequest",
"(",
"'Identify'",
")",
";",
"$",
"this",
"->",
"granularity... | Load date granularity from the server.
@return void | [
"Load",
"date",
"granularity",
"from",
"the",
"server",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Harvester.php#L225-L231 |
26,574 | vufind-org/vufindharvest | src/OaiPmh/Harvester.php | Harvester.checkResponseForErrors | protected function checkResponseForErrors($result)
{
// Detect errors and die if one is found:
if ($result->error) {
$attribs = $result->error->attributes();
// If this is a bad resumption token error and we're trying to
// restore a prior state, we should clean ... | php | protected function checkResponseForErrors($result)
{
// Detect errors and die if one is found:
if ($result->error) {
$attribs = $result->error->attributes();
// If this is a bad resumption token error and we're trying to
// restore a prior state, we should clean ... | [
"protected",
"function",
"checkResponseForErrors",
"(",
"$",
"result",
")",
"{",
"// Detect errors and die if one is found:",
"if",
"(",
"$",
"result",
"->",
"error",
")",
"{",
"$",
"attribs",
"=",
"$",
"result",
"->",
"error",
"->",
"attributes",
"(",
")",
";... | Check an OAI-PMH response for errors that need to be handled.
@param object $result OAI-PMH response (SimpleXML object)
@return void
@throws \Exception | [
"Check",
"an",
"OAI",
"-",
"PMH",
"response",
"for",
"errors",
"that",
"need",
"to",
"be",
"handled",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Harvester.php#L242-L263 |
26,575 | vufind-org/vufindharvest | src/OaiPmh/Harvester.php | Harvester.getRecords | protected function getRecords($params)
{
// Make the OAI-PMH request:
$response = $this->sendRequest('ListRecords', $params);
// Save the records from the response:
if ($response->ListRecords->record) {
$this->writeLine(
'Processing ' . count($response->L... | php | protected function getRecords($params)
{
// Make the OAI-PMH request:
$response = $this->sendRequest('ListRecords', $params);
// Save the records from the response:
if ($response->ListRecords->record) {
$this->writeLine(
'Processing ' . count($response->L... | [
"protected",
"function",
"getRecords",
"(",
"$",
"params",
")",
"{",
"// Make the OAI-PMH request:",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequest",
"(",
"'ListRecords'",
",",
"$",
"params",
")",
";",
"// Save the records from the response:",
"if",
"(",
"$... | Harvest records using OAI-PMH.
@param array $params GET parameters for ListRecords method.
@return mixed Resumption token if provided, false if finished | [
"Harvest",
"records",
"using",
"OAI",
"-",
"PMH",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Harvester.php#L272-L297 |
26,576 | vufind-org/vufindharvest | src/OaiPmh/Harvester.php | Harvester.getRecordsByDate | protected function getRecordsByDate($from = null, $set = null, $until = null)
{
$params = ['metadataPrefix' => $this->metadataPrefix];
if (!empty($from)) {
$params['from'] = $from;
}
if (!empty($set)) {
$params['set'] = $set;
}
if (!empty($unti... | php | protected function getRecordsByDate($from = null, $set = null, $until = null)
{
$params = ['metadataPrefix' => $this->metadataPrefix];
if (!empty($from)) {
$params['from'] = $from;
}
if (!empty($set)) {
$params['set'] = $set;
}
if (!empty($unti... | [
"protected",
"function",
"getRecordsByDate",
"(",
"$",
"from",
"=",
"null",
",",
"$",
"set",
"=",
"null",
",",
"$",
"until",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"[",
"'metadataPrefix'",
"=>",
"$",
"this",
"->",
"metadataPrefix",
"]",
";",
"if",
... | Harvest records via OAI-PMH using date and set.
@param string $from Harvest start date (null for no specific start).
@param string $set Set to harvest (null for all records).
@param string $until Harvest end date (null for no specific end).
@return mixed Resumption token if provided, false if finished | [
"Harvest",
"records",
"via",
"OAI",
"-",
"PMH",
"using",
"date",
"and",
"set",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/Harvester.php#L308-L321 |
26,577 | iherwig/wcmf | src/wcmf/application/controller/AdminController.php | AdminController.clearCaches | protected function clearCaches() {
$config = $this->getConfiguration();
foreach($config->getSections() as $section) {
$sectionValues = $config->getSection($section, true);
if (isset($sectionValues['__class'])) {
$instance = ObjectFactory::getInstance($section);
if ($instance instance... | php | protected function clearCaches() {
$config = $this->getConfiguration();
foreach($config->getSections() as $section) {
$sectionValues = $config->getSection($section, true);
if (isset($sectionValues['__class'])) {
$instance = ObjectFactory::getInstance($section);
if ($instance instance... | [
"protected",
"function",
"clearCaches",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"->",
"getSections",
"(",
")",
"as",
"$",
"section",
")",
"{",
"$",
"sectionValues",
"=",
"$... | Clear all cache instances found in the configuration | [
"Clear",
"all",
"cache",
"instances",
"found",
"in",
"the",
"configuration"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/application/controller/AdminController.php#L56-L70 |
26,578 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.getProxyObject | protected function getProxyObject(ObjectId $umi, $buildDepth) {
self::$logger->debug("Get proxy object for: ".$umi);
// local objects don't have a proxy
if (strlen($umi->getPrefix()) == 0) {
return null;
}
// check if the proxy object was loaded already
$proxy = $this->getRegisteredProxy... | php | protected function getProxyObject(ObjectId $umi, $buildDepth) {
self::$logger->debug("Get proxy object for: ".$umi);
// local objects don't have a proxy
if (strlen($umi->getPrefix()) == 0) {
return null;
}
// check if the proxy object was loaded already
$proxy = $this->getRegisteredProxy... | [
"protected",
"function",
"getProxyObject",
"(",
"ObjectId",
"$",
"umi",
",",
"$",
"buildDepth",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"debug",
"(",
"\"Get proxy object for: \"",
".",
"$",
"umi",
")",
";",
"// local objects don't have a proxy",
"if",
"(",
... | Get the proxy object for a remote object.
This method makes sure that a proxy for the given remote object exists.
If it does not exist, it will be created.
@param $umi The universal model id (oid with server prefix)
@param $buildDepth buildDepth One of the BUILDDEPTH constants or a number describing the number of gener... | [
"Get",
"the",
"proxy",
"object",
"for",
"a",
"remote",
"object",
".",
"This",
"method",
"makes",
"sure",
"that",
"a",
"proxy",
"for",
"the",
"given",
"remote",
"object",
"exists",
".",
"If",
"it",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
... | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L172-L207 |
26,579 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.registerProxyObject | protected function registerProxyObject(ObjectID $umi, PersistentObject $obj, $buildDepth) {
$oid = $obj->getOID();
if (strlen($oid->getPrefix()) > 0) {
self::$logger->debug("NOT A PROXY");
return;
}
$this->registerObject($umi, $obj, $buildDepth, self::PROXY_OBJECTS_SESSION_VARNAME);
} | php | protected function registerProxyObject(ObjectID $umi, PersistentObject $obj, $buildDepth) {
$oid = $obj->getOID();
if (strlen($oid->getPrefix()) > 0) {
self::$logger->debug("NOT A PROXY");
return;
}
$this->registerObject($umi, $obj, $buildDepth, self::PROXY_OBJECTS_SESSION_VARNAME);
} | [
"protected",
"function",
"registerProxyObject",
"(",
"ObjectID",
"$",
"umi",
",",
"PersistentObject",
"$",
"obj",
",",
"$",
"buildDepth",
")",
"{",
"$",
"oid",
"=",
"$",
"obj",
"->",
"getOID",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"oid",
"->",
... | Save a proxy object in the session.
@param $umi The universal model id (oid with server prefix)
@param $obj The proxy object.
@param $buildDepth The depth the object was loaded. | [
"Save",
"a",
"proxy",
"object",
"in",
"the",
"session",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L297-L304 |
26,580 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.registerRemoteObject | protected function registerRemoteObject(ObjectId $umi, PersistentObject $obj, $buildDepth) {
// TODO: fix caching remote objects (invalidate cache entry, if an association to the object changes)
return;
$this->registerObject($umi, $obj, $buildDepth, self::REMOTE_OBJECTS_SESSION_VARNAME);
} | php | protected function registerRemoteObject(ObjectId $umi, PersistentObject $obj, $buildDepth) {
// TODO: fix caching remote objects (invalidate cache entry, if an association to the object changes)
return;
$this->registerObject($umi, $obj, $buildDepth, self::REMOTE_OBJECTS_SESSION_VARNAME);
} | [
"protected",
"function",
"registerRemoteObject",
"(",
"ObjectId",
"$",
"umi",
",",
"PersistentObject",
"$",
"obj",
",",
"$",
"buildDepth",
")",
"{",
"// TODO: fix caching remote objects (invalidate cache entry, if an association to the object changes)",
"return",
";",
"$",
"t... | Save a remote object in the session.
@param $umi The universal model id (oid with server prefix)
@param $obj The remote object.
@param $buildDepth The depth the object was loaded. | [
"Save",
"a",
"remote",
"object",
"in",
"the",
"session",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L312-L317 |
26,581 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.registerObject | protected function registerObject(ObjectId $umi, PersistentObject $obj, $buildDepth, $varName) {
if ($buildDepth == 0) {
$buildDepth=BuildDepth::SINGLE;
}
// save the object in the session
$umiStr = $umi->toString();
$objects = $this->session->get($varName);
if (!isset($objects[$umiStr])) ... | php | protected function registerObject(ObjectId $umi, PersistentObject $obj, $buildDepth, $varName) {
if ($buildDepth == 0) {
$buildDepth=BuildDepth::SINGLE;
}
// save the object in the session
$umiStr = $umi->toString();
$objects = $this->session->get($varName);
if (!isset($objects[$umiStr])) ... | [
"protected",
"function",
"registerObject",
"(",
"ObjectId",
"$",
"umi",
",",
"PersistentObject",
"$",
"obj",
",",
"$",
"buildDepth",
",",
"$",
"varName",
")",
"{",
"if",
"(",
"$",
"buildDepth",
"==",
"0",
")",
"{",
"$",
"buildDepth",
"=",
"BuildDepth",
"... | Save a object in the given session variable.
@param $umi The universal model id (oid with server prefix)
@param $obj The object to register.
@param $buildDepth The depth the object was loaded.
@param $varName The session variable name. | [
"Save",
"a",
"object",
"in",
"the",
"given",
"session",
"variable",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L326-L338 |
26,582 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.getRegisteredProxyObject | protected function getRegisteredProxyObject(ObjectId $umi, $buildDepth) {
$proxy = $this->getRegisteredObject($umi, $buildDepth, self::PROXY_OBJECTS_SESSION_VARNAME);
return $proxy;
} | php | protected function getRegisteredProxyObject(ObjectId $umi, $buildDepth) {
$proxy = $this->getRegisteredObject($umi, $buildDepth, self::PROXY_OBJECTS_SESSION_VARNAME);
return $proxy;
} | [
"protected",
"function",
"getRegisteredProxyObject",
"(",
"ObjectId",
"$",
"umi",
",",
"$",
"buildDepth",
")",
"{",
"$",
"proxy",
"=",
"$",
"this",
"->",
"getRegisteredObject",
"(",
"$",
"umi",
",",
"$",
"buildDepth",
",",
"self",
"::",
"PROXY_OBJECTS_SESSION_... | Get a proxy object from the session.
@param $umi The universal model id (oid with server prefix)
@param $buildDepth The requested build depth.
@return The proxy object or null if not found. | [
"Get",
"a",
"proxy",
"object",
"from",
"the",
"session",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L346-L349 |
26,583 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.getRegisteredRemoteObject | protected function getRegisteredRemoteObject(ObjectId $umi, $buildDepth) {
$object = $this->getRegisteredObject($umi, $buildDepth, self::REMOTE_OBJECTS_SESSION_VARNAME);
return $object;
} | php | protected function getRegisteredRemoteObject(ObjectId $umi, $buildDepth) {
$object = $this->getRegisteredObject($umi, $buildDepth, self::REMOTE_OBJECTS_SESSION_VARNAME);
return $object;
} | [
"protected",
"function",
"getRegisteredRemoteObject",
"(",
"ObjectId",
"$",
"umi",
",",
"$",
"buildDepth",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"getRegisteredObject",
"(",
"$",
"umi",
",",
"$",
"buildDepth",
",",
"self",
"::",
"REMOTE_OBJECTS_SESSI... | Get a remote object from the session.
@param $umi The universal model id (oid with server prefix)
@param $buildDepth The requested build depth.
@return The remote object or null if not found. | [
"Get",
"a",
"remote",
"object",
"from",
"the",
"session",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L357-L360 |
26,584 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.getRegisteredObject | protected function getRegisteredObject(ObjectId $umi, $buildDepth, $varName) {
if ($buildDepth == 0) {
$buildDepth=BuildDepth::SINGLE;
}
$umiStr = $umi->toString();
$objects = $this->session->get($varName);
if (isset($objects[$umiStr]) && isset($objects[$umiStr][$buildDepth])) {
return $... | php | protected function getRegisteredObject(ObjectId $umi, $buildDepth, $varName) {
if ($buildDepth == 0) {
$buildDepth=BuildDepth::SINGLE;
}
$umiStr = $umi->toString();
$objects = $this->session->get($varName);
if (isset($objects[$umiStr]) && isset($objects[$umiStr][$buildDepth])) {
return $... | [
"protected",
"function",
"getRegisteredObject",
"(",
"ObjectId",
"$",
"umi",
",",
"$",
"buildDepth",
",",
"$",
"varName",
")",
"{",
"if",
"(",
"$",
"buildDepth",
"==",
"0",
")",
"{",
"$",
"buildDepth",
"=",
"BuildDepth",
"::",
"SINGLE",
";",
"}",
"$",
... | Get a object from the given session variable.
@param $umi The universal model id (oid with server prefix)
@param $buildDepth The requested build depth.
@param $varName The session variable name
@return The object or null if not found. | [
"Get",
"a",
"object",
"from",
"the",
"given",
"session",
"variable",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L369-L388 |
26,585 | iherwig/wcmf | src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php | RemoteCapablePersistenceFacade.makeUmis | protected function makeUmis($oids, $umiPrefix) {
$result = [];
foreach ($oids as $oid) {
if (strlen($oid->getPrefix()) == 0) {
$umi = new ObjectId($oid->getType(), $oid->getId(), $umiPrefix);
$result[] = $umi;
}
}
return $result;
} | php | protected function makeUmis($oids, $umiPrefix) {
$result = [];
foreach ($oids as $oid) {
if (strlen($oid->getPrefix()) == 0) {
$umi = new ObjectId($oid->getType(), $oid->getId(), $umiPrefix);
$result[] = $umi;
}
}
return $result;
} | [
"protected",
"function",
"makeUmis",
"(",
"$",
"oids",
",",
"$",
"umiPrefix",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"oids",
"as",
"$",
"oid",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"oid",
"->",
"getPrefix",
"(",
")",... | Replace all object ids in an array with the umis according to
the given umiPrefix.
@param $oids The array of oids
@param $umiPrefix The umi prefix
@return The array of umis | [
"Replace",
"all",
"object",
"ids",
"in",
"an",
"array",
"with",
"the",
"umis",
"according",
"to",
"the",
"given",
"umiPrefix",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/impl/RemoteCapablePersistenceFacade.php#L397-L406 |
26,586 | iherwig/wcmf | src/wcmf/lib/presentation/impl/DefaultRequestListener.php | DefaultRequestListener.listen | public function listen(ApplicationEvent $event) {
if ($event->getStage() == ApplicationEvent::BEFORE_ROUTE_ACTION) {
$request = $event->getRequest();
if ($request != null) {
$this->transformRequest($request);
}
}
else if ($event->getStage() == ApplicationEvent::AFTER_EXECUTE_CONTRO... | php | public function listen(ApplicationEvent $event) {
if ($event->getStage() == ApplicationEvent::BEFORE_ROUTE_ACTION) {
$request = $event->getRequest();
if ($request != null) {
$this->transformRequest($request);
}
}
else if ($event->getStage() == ApplicationEvent::AFTER_EXECUTE_CONTRO... | [
"public",
"function",
"listen",
"(",
"ApplicationEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getStage",
"(",
")",
"==",
"ApplicationEvent",
"::",
"BEFORE_ROUTE_ACTION",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(... | Listen to ApplicationEvent
@param $event ApplicationEvent instance | [
"Listen",
"to",
"ApplicationEvent"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/presentation/impl/DefaultRequestListener.php#L40-L54 |
26,587 | skie/plum_search | src/FormParameter/BaseParameter.php | BaseParameter._process | protected function _process()
{
$name = $this->config('field');
$this->value = $this->_registry->data($name);
$this->_processed = true;
} | php | protected function _process()
{
$name = $this->config('field');
$this->value = $this->_registry->data($name);
$this->_processed = true;
} | [
"protected",
"function",
"_process",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"config",
"(",
"'field'",
")",
";",
"$",
"this",
"->",
"value",
"=",
"$",
"this",
"->",
"_registry",
"->",
"data",
"(",
"$",
"name",
")",
";",
"$",
"this",
"... | process param parsing
@return void | [
"process",
"param",
"parsing"
] | 24d981e240bff7c15731981d6f9b3056abdaf80e | https://github.com/skie/plum_search/blob/24d981e240bff7c15731981d6f9b3056abdaf80e/src/FormParameter/BaseParameter.php#L111-L116 |
26,588 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.processFile | protected function processFile($filename, $configArray=[], $parsedFiles=[]) {
// avoid circular includes
if (!in_array($filename, $parsedFiles)) {
$parsedFiles[] = $filename;
$content = $this->parseIniFile($filename);
// process includes
$includes = $this->getConfigIncludes($co... | php | protected function processFile($filename, $configArray=[], $parsedFiles=[]) {
// avoid circular includes
if (!in_array($filename, $parsedFiles)) {
$parsedFiles[] = $filename;
$content = $this->parseIniFile($filename);
// process includes
$includes = $this->getConfigIncludes($co... | [
"protected",
"function",
"processFile",
"(",
"$",
"filename",
",",
"$",
"configArray",
"=",
"[",
"]",
",",
"$",
"parsedFiles",
"=",
"[",
"]",
")",
"{",
"// avoid circular includes\r",
"if",
"(",
"!",
"in_array",
"(",
"$",
"filename",
",",
"$",
"parsedFiles... | Process the given file recursively
@param $filename The filename
@param $configArray Configuration array
@param $parsedFiles Parsed files
@return Associative array with keys 'config' (configuration array) and 'files'
(array of parsed files) | [
"Process",
"the",
"given",
"file",
"recursively"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L174-L196 |
26,589 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.serialize | protected function serialize() {
if (!$this->isModified() && ($cacheFile = $this->getSerializeFilename($this->addedFiles))) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Serialize configuration: ".join(',', $this->addedFiles)." to file: ".$cacheFile);
}
$this->fileUti... | php | protected function serialize() {
if (!$this->isModified() && ($cacheFile = $this->getSerializeFilename($this->addedFiles))) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Serialize configuration: ".join(',', $this->addedFiles)." to file: ".$cacheFile);
}
$this->fileUti... | [
"protected",
"function",
"serialize",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isModified",
"(",
")",
"&&",
"(",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getSerializeFilename",
"(",
"$",
"this",
"->",
"addedFiles",
")",
")",
")",
"{",
"if... | Store the instance in the file system. If the instance is modified, this call is ignored. | [
"Store",
"the",
"instance",
"in",
"the",
"file",
"system",
".",
"If",
"the",
"instance",
"is",
"modified",
"this",
"call",
"is",
"ignored",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L666-L680 |
26,590 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.unserialize | protected function unserialize($parsedFiles) {
if (!$this->isModified() && ($cacheFile = $this->getSerializeFilename($parsedFiles)) && file_exists($cacheFile)) {
$parsedFiles[] = __FILE__;
if (!$this->checkFileDate($parsedFiles, $cacheFile)) {
$vars = unserialize(file_get_contents($cacheFile... | php | protected function unserialize($parsedFiles) {
if (!$this->isModified() && ($cacheFile = $this->getSerializeFilename($parsedFiles)) && file_exists($cacheFile)) {
$parsedFiles[] = __FILE__;
if (!$this->checkFileDate($parsedFiles, $cacheFile)) {
$vars = unserialize(file_get_contents($cacheFile... | [
"protected",
"function",
"unserialize",
"(",
"$",
"parsedFiles",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isModified",
"(",
")",
"&&",
"(",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getSerializeFilename",
"(",
"$",
"parsedFiles",
")",
")",
"&&",
... | Retrieve parsed ini data from the file system and update the current instance.
If the current instance is modified or any file given in parsedFiles
is newer than the serialized data, this call is ignored.
If InifileConfiguration class changed, the call will be ignored as well.
@param $parsedFiles An array of ini filena... | [
"Retrieve",
"parsed",
"ini",
"data",
"from",
"the",
"file",
"system",
"and",
"update",
"the",
"current",
"instance",
".",
"If",
"the",
"current",
"instance",
"is",
"modified",
"or",
"any",
"file",
"given",
"in",
"parsedFiles",
"is",
"newer",
"than",
"the",
... | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L690-L712 |
26,591 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.checkFileDate | protected function checkFileDate($fileList, $referenceFile) {
foreach ($fileList as $file) {
if (@filemtime($file) > @filemtime($referenceFile)) {
return true;
}
}
return false;
} | php | protected function checkFileDate($fileList, $referenceFile) {
foreach ($fileList as $file) {
if (@filemtime($file) > @filemtime($referenceFile)) {
return true;
}
}
return false;
} | [
"protected",
"function",
"checkFileDate",
"(",
"$",
"fileList",
",",
"$",
"referenceFile",
")",
"{",
"foreach",
"(",
"$",
"fileList",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"@",
"filemtime",
"(",
"$",
"file",
")",
">",
"@",
"filemtime",
"(",
"$",
"r... | Check if one file in fileList is newer than the referenceFile.
@param $fileList An array of files
@param $referenceFile The file to check against
@return True, if one of the files is newer, false else | [
"Check",
"if",
"one",
"file",
"in",
"fileList",
"is",
"newer",
"than",
"the",
"referenceFile",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L735-L742 |
26,592 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.configChanged | protected function configChanged() {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Configuration is changed");
}
if (ObjectFactory::isConfigured()) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Emitting change event");
}
ObjectFactory::... | php | protected function configChanged() {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Configuration is changed");
}
if (ObjectFactory::isConfigured()) {
if (self::$logger->isDebugEnabled()) {
self::$logger->debug("Emitting change event");
}
ObjectFactory::... | [
"protected",
"function",
"configChanged",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
"->",
"isDebugEnabled",
"(",
")",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"debug",
"(",
"\"Configuration is changed\"",
")",
";",
"}",
"if",
"(",
"Objec... | Notify configuration change listeners | [
"Notify",
"configuration",
"change",
"listeners"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L747-L758 |
26,593 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.buildLookupTable | protected function buildLookupTable() {
$this->lookupTable = [];
foreach ($this->configArray as $section => $entry) {
// create section entry
$lookupSectionKey = strtolower($section.':');
$this->lookupTable[$lookupSectionKey] = [$section];
// create key entries
foreach ($ent... | php | protected function buildLookupTable() {
$this->lookupTable = [];
foreach ($this->configArray as $section => $entry) {
// create section entry
$lookupSectionKey = strtolower($section.':');
$this->lookupTable[$lookupSectionKey] = [$section];
// create key entries
foreach ($ent... | [
"protected",
"function",
"buildLookupTable",
"(",
")",
"{",
"$",
"this",
"->",
"lookupTable",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"configArray",
"as",
"$",
"section",
"=>",
"$",
"entry",
")",
"{",
"// create section entry\r",
"$",
"looku... | Build the internal lookup table | [
"Build",
"the",
"internal",
"lookup",
"table"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L763-L775 |
26,594 | iherwig/wcmf | src/wcmf/lib/config/impl/InifileConfiguration.php | InifileConfiguration.lookup | protected function lookup($section, $key=null) {
$lookupKey = strtolower($section).':'.strtolower($key);
if (isset($this->lookupTable[$lookupKey])) {
return $this->lookupTable[$lookupKey];
}
return null;
} | php | protected function lookup($section, $key=null) {
$lookupKey = strtolower($section).':'.strtolower($key);
if (isset($this->lookupTable[$lookupKey])) {
return $this->lookupTable[$lookupKey];
}
return null;
} | [
"protected",
"function",
"lookup",
"(",
"$",
"section",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"lookupKey",
"=",
"strtolower",
"(",
"$",
"section",
")",
".",
"':'",
".",
"strtolower",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | Lookup section and key.
@param $section The section to lookup
@param $key The key to lookup (optional)
@return Array with section as first entry and key as second or null if not found | [
"Lookup",
"section",
"and",
"key",
"."
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/config/impl/InifileConfiguration.php#L783-L789 |
26,595 | vufind-org/vufindharvest | src/OaiPmh/StateManager.php | StateManager.loadDate | public function loadDate()
{
return (file_exists($this->lastHarvestFile))
? trim(current(file($this->lastHarvestFile))) : null;
} | php | public function loadDate()
{
return (file_exists($this->lastHarvestFile))
? trim(current(file($this->lastHarvestFile))) : null;
} | [
"public",
"function",
"loadDate",
"(",
")",
"{",
"return",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"lastHarvestFile",
")",
")",
"?",
"trim",
"(",
"current",
"(",
"file",
"(",
"$",
"this",
"->",
"lastHarvestFile",
")",
")",
")",
":",
"null",
";",
... | Retrieve the date from the "last harvested" file and use it as our start
date if it is available.
@return string | [
"Retrieve",
"the",
"date",
"from",
"the",
"last",
"harvested",
"file",
"and",
"use",
"it",
"as",
"our",
"start",
"date",
"if",
"it",
"is",
"available",
"."
] | 43a42d1e2292fbba8974a26ace3d522551a1a88f | https://github.com/vufind-org/vufindharvest/blob/43a42d1e2292fbba8974a26ace3d522551a1a88f/src/OaiPmh/StateManager.php#L94-L98 |
26,596 | iherwig/wcmf | src/wcmf/lib/model/impl/AbstractNodeSerializer.php | AbstractNodeSerializer.getNodeTemplate | protected function getNodeTemplate($oid) {
// load object if existing to get the original data
$originalNode = $this->persistenceFacade->load($oid, BuildDepth::SINGLE);
// create the request node and copy the orignal data
$class = get_class($this->persistenceFacade->create($oid->getType(), BuildDepth::... | php | protected function getNodeTemplate($oid) {
// load object if existing to get the original data
$originalNode = $this->persistenceFacade->load($oid, BuildDepth::SINGLE);
// create the request node and copy the orignal data
$class = get_class($this->persistenceFacade->create($oid->getType(), BuildDepth::... | [
"protected",
"function",
"getNodeTemplate",
"(",
"$",
"oid",
")",
"{",
"// load object if existing to get the original data",
"$",
"originalNode",
"=",
"$",
"this",
"->",
"persistenceFacade",
"->",
"load",
"(",
"$",
"oid",
",",
"BuildDepth",
"::",
"SINGLE",
")",
"... | Get a Node instance based on the original values to merge the deserialized values into
@param $oid The object id of the Node
@return Node | [
"Get",
"a",
"Node",
"instance",
"based",
"on",
"the",
"original",
"values",
"to",
"merge",
"the",
"deserialized",
"values",
"into"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/impl/AbstractNodeSerializer.php#L40-L51 |
26,597 | iherwig/wcmf | src/wcmf/lib/model/impl/AbstractNodeSerializer.php | AbstractNodeSerializer.deserializeValue | protected function deserializeValue(Node $node, $key, $value) {
if (!is_array($value)) {
// force set value to avoid exceptions in this stage
$node->setValue($key, $value, true);
}
else {
$role = $key;
if ($this->isMultiValued($node, $role)) {
// deserialize children
... | php | protected function deserializeValue(Node $node, $key, $value) {
if (!is_array($value)) {
// force set value to avoid exceptions in this stage
$node->setValue($key, $value, true);
}
else {
$role = $key;
if ($this->isMultiValued($node, $role)) {
// deserialize children
... | [
"protected",
"function",
"deserializeValue",
"(",
"Node",
"$",
"node",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"// force set value to avoid exceptions in this stage",
"$",
"node",
"->",
"set... | Deserialize a node value
@param $node Node instance
@param $key The value name or type if value is an array
@param $value The value or child data, if value is an array | [
"Deserialize",
"a",
"node",
"value"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/impl/AbstractNodeSerializer.php#L59-L76 |
26,598 | iherwig/wcmf | src/wcmf/lib/model/impl/AbstractNodeSerializer.php | AbstractNodeSerializer.isMultiValued | protected function isMultiValued(Node $node, $role) {
$isMultiValued = false;
$mapper = $node->getMapper();
if ($mapper->hasRelation($role)) {
$relation = $mapper->getRelation($role);
$isMultiValued = $relation->isMultiValued();
}
return $isMultiValued;
} | php | protected function isMultiValued(Node $node, $role) {
$isMultiValued = false;
$mapper = $node->getMapper();
if ($mapper->hasRelation($role)) {
$relation = $mapper->getRelation($role);
$isMultiValued = $relation->isMultiValued();
}
return $isMultiValued;
} | [
"protected",
"function",
"isMultiValued",
"(",
"Node",
"$",
"node",
",",
"$",
"role",
")",
"{",
"$",
"isMultiValued",
"=",
"false",
";",
"$",
"mapper",
"=",
"$",
"node",
"->",
"getMapper",
"(",
")",
";",
"if",
"(",
"$",
"mapper",
"->",
"hasRelation",
... | Check if a relation is multi valued
@param $node The Node that has the relation
@param $role The role of the relation | [
"Check",
"if",
"a",
"relation",
"is",
"multi",
"valued"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/model/impl/AbstractNodeSerializer.php#L83-L91 |
26,599 | iherwig/wcmf | src/wcmf/lib/persistence/AttributeDescription.php | AttributeDescription.matchTags | public function matchTags(array $tags=[], $matchMode='all') {
$numGivenTags = sizeof($tags);
if (sizeof($numGivenTags) == 0) {
return true;
}
$result = true;
$diff = sizeof(array_diff($tags, $this->tags));
switch ($matchMode) {
case 'all':
$result = ($diff == 0);
brea... | php | public function matchTags(array $tags=[], $matchMode='all') {
$numGivenTags = sizeof($tags);
if (sizeof($numGivenTags) == 0) {
return true;
}
$result = true;
$diff = sizeof(array_diff($tags, $this->tags));
switch ($matchMode) {
case 'all':
$result = ($diff == 0);
brea... | [
"public",
"function",
"matchTags",
"(",
"array",
"$",
"tags",
"=",
"[",
"]",
",",
"$",
"matchMode",
"=",
"'all'",
")",
"{",
"$",
"numGivenTags",
"=",
"sizeof",
"(",
"$",
"tags",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"numGivenTags",
")",
"==",
"0... | Check if this attribute is tagged with the given application specific tags
@param $tags An array of tags that the attribute should match. Empty array results in true the given matchMode (default: empty array)
@param $matchMode One of 'all', 'none', 'any', defines how the attribute's tags should match the given tags (de... | [
"Check",
"if",
"this",
"attribute",
"is",
"tagged",
"with",
"the",
"given",
"application",
"specific",
"tags"
] | 2542b8d4139464d39a9a8ce8a954dfecf700c41b | https://github.com/iherwig/wcmf/blob/2542b8d4139464d39a9a8ce8a954dfecf700c41b/src/wcmf/lib/persistence/AttributeDescription.php#L70-L89 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.