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
partition
stringclasses
1 value
api-platform/core
src/DataProvider/Pagination.php
Pagination.getEnabled
private function getEnabled(array $context, string $resourceClass = null, string $operationName = null, bool $partial = false): bool { $enabled = $this->options[$partial ? 'partial' : 'enabled']; $clientEnabled = $this->options[$partial ? 'client_partial' : 'client_enabled']; if (null !== $...
php
private function getEnabled(array $context, string $resourceClass = null, string $operationName = null, bool $partial = false): bool { $enabled = $this->options[$partial ? 'partial' : 'enabled']; $clientEnabled = $this->options[$partial ? 'client_partial' : 'client_enabled']; if (null !== $...
[ "private", "function", "getEnabled", "(", "array", "$", "context", ",", "string", "$", "resourceClass", "=", "null", ",", "string", "$", "operationName", "=", "null", ",", "bool", "$", "partial", "=", "false", ")", ":", "bool", "{", "$", "enabled", "=", ...
Is the classic or partial pagination enabled?
[ "Is", "the", "classic", "or", "partial", "pagination", "enabled?" ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/DataProvider/Pagination.php#L185-L202
train
api-platform/core
src/DataProvider/Pagination.php
Pagination.getParameterFromContext
private function getParameterFromContext(array $context, string $parameterName, $default = null) { $filters = $context['filters'] ?? []; return \array_key_exists($parameterName, $filters) ? $filters[$parameterName] : $default; }
php
private function getParameterFromContext(array $context, string $parameterName, $default = null) { $filters = $context['filters'] ?? []; return \array_key_exists($parameterName, $filters) ? $filters[$parameterName] : $default; }
[ "private", "function", "getParameterFromContext", "(", "array", "$", "context", ",", "string", "$", "parameterName", ",", "$", "default", "=", "null", ")", "{", "$", "filters", "=", "$", "context", "[", "'filters'", "]", "??", "[", "]", ";", "return", "\...
Gets the given pagination parameter name from the given context. @param mixed|null $default
[ "Gets", "the", "given", "pagination", "parameter", "name", "from", "the", "given", "context", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/DataProvider/Pagination.php#L209-L214
train
api-platform/core
src/Api/FilterCollectionFactory.php
FilterCollectionFactory.createFilterCollectionFromLocator
public function createFilterCollectionFromLocator(ContainerInterface $filterLocator): FilterCollection { $filters = []; foreach ($this->filtersIds as $filterId) { if ($filterLocator->has($filterId)) { $filters[$filterId] = $filterLocator->get($filterId); } ...
php
public function createFilterCollectionFromLocator(ContainerInterface $filterLocator): FilterCollection { $filters = []; foreach ($this->filtersIds as $filterId) { if ($filterLocator->has($filterId)) { $filters[$filterId] = $filterLocator->get($filterId); } ...
[ "public", "function", "createFilterCollectionFromLocator", "(", "ContainerInterface", "$", "filterLocator", ")", ":", "FilterCollection", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "filtersIds", "as", "$", "filterId", ")", "{", ...
Creates a filter collection from a filter locator.
[ "Creates", "a", "filter", "collection", "from", "a", "filter", "locator", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Api/FilterCollectionFactory.php#L40-L51
train
api-platform/core
src/Api/FilterLocatorTrait.php
FilterLocatorTrait.setFilterLocator
private function setFilterLocator($filterLocator, bool $allowNull = false): void { if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) { if ($filterLocator instanceof FilterCollection) { @trigg...
php
private function setFilterLocator($filterLocator, bool $allowNull = false): void { if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) { if ($filterLocator instanceof FilterCollection) { @trigg...
[ "private", "function", "setFilterLocator", "(", "$", "filterLocator", ",", "bool", "$", "allowNull", "=", "false", ")", ":", "void", "{", "if", "(", "$", "filterLocator", "instanceof", "ContainerInterface", "||", "$", "filterLocator", "instanceof", "FilterCollecti...
Sets a filter locator with a backward compatibility. @param ContainerInterface|FilterCollection|null $filterLocator
[ "Sets", "a", "filter", "locator", "with", "a", "backward", "compatibility", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Api/FilterLocatorTrait.php#L35-L46
train
api-platform/core
src/Api/FilterLocatorTrait.php
FilterLocatorTrait.getFilter
private function getFilter(string $filterId): ?FilterInterface { if ($this->filterLocator instanceof ContainerInterface && $this->filterLocator->has($filterId)) { return $this->filterLocator->get($filterId); } if ($this->filterLocator instanceof FilterCollection && $this->filter...
php
private function getFilter(string $filterId): ?FilterInterface { if ($this->filterLocator instanceof ContainerInterface && $this->filterLocator->has($filterId)) { return $this->filterLocator->get($filterId); } if ($this->filterLocator instanceof FilterCollection && $this->filter...
[ "private", "function", "getFilter", "(", "string", "$", "filterId", ")", ":", "?", "FilterInterface", "{", "if", "(", "$", "this", "->", "filterLocator", "instanceof", "ContainerInterface", "&&", "$", "this", "->", "filterLocator", "->", "has", "(", "$", "fi...
Gets a filter with a backward compatibility.
[ "Gets", "a", "filter", "with", "a", "backward", "compatibility", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Api/FilterLocatorTrait.php#L51-L62
train
api-platform/core
src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
ValidatorPropertyMetadataFactory.isRequiredByGroups
private function isRequiredByGroups(ValidatorPropertyMetadataInterface $validatorPropertyMetadata, array $options): bool { foreach ($options['validation_groups'] as $validationGroup) { if (!\is_string($validationGroup)) { continue; } foreach ($validatorPr...
php
private function isRequiredByGroups(ValidatorPropertyMetadataInterface $validatorPropertyMetadata, array $options): bool { foreach ($options['validation_groups'] as $validationGroup) { if (!\is_string($validationGroup)) { continue; } foreach ($validatorPr...
[ "private", "function", "isRequiredByGroups", "(", "ValidatorPropertyMetadataInterface", "$", "validatorPropertyMetadata", ",", "array", "$", "options", ")", ":", "bool", "{", "foreach", "(", "$", "options", "[", "'validation_groups'", "]", "as", "$", "validationGroup"...
Tests if the property is required because of its validation groups.
[ "Tests", "if", "the", "property", "is", "required", "because", "of", "its", "validation", "groups", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php#L117-L132
train
api-platform/core
src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php
ValidatorPropertyMetadataFactory.isRequired
private function isRequired(Constraint $constraint): bool { foreach (self::REQUIRED_CONSTRAINTS as $requiredConstraint) { if ($constraint instanceof $requiredConstraint) { return true; } } return false; }
php
private function isRequired(Constraint $constraint): bool { foreach (self::REQUIRED_CONSTRAINTS as $requiredConstraint) { if ($constraint instanceof $requiredConstraint) { return true; } } return false; }
[ "private", "function", "isRequired", "(", "Constraint", "$", "constraint", ")", ":", "bool", "{", "foreach", "(", "self", "::", "REQUIRED_CONSTRAINTS", "as", "$", "requiredConstraint", ")", "{", "if", "(", "$", "constraint", "instanceof", "$", "requiredConstrain...
Is this constraint making the related property required?
[ "Is", "this", "constraint", "making", "the", "related", "property", "required?" ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactory.php#L137-L146
train
api-platform/core
src/JsonApi/Serializer/ItemNormalizer.php
ItemNormalizer.getPopulatedRelations
private function getPopulatedRelations($object, ?string $format, array $context, array $relationships): array { $data = []; if (!isset($context['resource_class'])) { return $data; } unset($context['api_included']); foreach ($relationships as $relationshipDataArr...
php
private function getPopulatedRelations($object, ?string $format, array $context, array $relationships): array { $data = []; if (!isset($context['resource_class'])) { return $data; } unset($context['api_included']); foreach ($relationships as $relationshipDataArr...
[ "private", "function", "getPopulatedRelations", "(", "$", "object", ",", "?", "string", "$", "format", ",", "array", "$", "context", ",", "array", "$", "relationships", ")", ":", "array", "{", "$", "data", "=", "[", "]", ";", "if", "(", "!", "isset", ...
Populates relationships keys. @param object $object @throws UnexpectedValueException
[ "Populates", "relationships", "keys", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/JsonApi/Serializer/ItemNormalizer.php#L330-L375
train
api-platform/core
src/JsonApi/Serializer/ItemNormalizer.php
ItemNormalizer.getRelatedResources
private function getRelatedResources($object, ?string $format, array $context, array $relationships): array { if (!isset($context['api_included'])) { return []; } $included = []; foreach ($relationships as $relationshipDataArray) { if (!\in_array($relationshi...
php
private function getRelatedResources($object, ?string $format, array $context, array $relationships): array { if (!isset($context['api_included'])) { return []; } $included = []; foreach ($relationships as $relationshipDataArray) { if (!\in_array($relationshi...
[ "private", "function", "getRelatedResources", "(", "$", "object", ",", "?", "string", "$", "format", ",", "array", "$", "context", ",", "array", "$", "relationships", ")", ":", "array", "{", "if", "(", "!", "isset", "(", "$", "context", "[", "'api_includ...
Populates included keys.
[ "Populates", "included", "keys", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/JsonApi/Serializer/ItemNormalizer.php#L380-L415
train
api-platform/core
src/JsonApi/Serializer/ItemNormalizer.php
ItemNormalizer.getJsonApiCacheKey
private function getJsonApiCacheKey(?string $format, array $context) { try { return md5($format.serialize($context)); } catch (\Exception $exception) { // The context cannot be serialized, skip the cache return false; } }
php
private function getJsonApiCacheKey(?string $format, array $context) { try { return md5($format.serialize($context)); } catch (\Exception $exception) { // The context cannot be serialized, skip the cache return false; } }
[ "private", "function", "getJsonApiCacheKey", "(", "?", "string", "$", "format", ",", "array", "$", "context", ")", "{", "try", "{", "return", "md5", "(", "$", "format", ".", "serialize", "(", "$", "context", ")", ")", ";", "}", "catch", "(", "\\", "E...
Gets the cache key to use. @return bool|string
[ "Gets", "the", "cache", "key", "to", "use", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/JsonApi/Serializer/ItemNormalizer.php#L422-L430
train
api-platform/core
src/EventListener/RespondListener.php
RespondListener.onKernelView
public function onKernelView(GetResponseForControllerResultEvent $event): void { $controllerResult = $event->getControllerResult(); $request = $event->getRequest(); $attributes = RequestAttributesExtractor::extractAttributes($request); if ($controllerResult instanceof Response && ($...
php
public function onKernelView(GetResponseForControllerResultEvent $event): void { $controllerResult = $event->getControllerResult(); $request = $event->getRequest(); $attributes = RequestAttributesExtractor::extractAttributes($request); if ($controllerResult instanceof Response && ($...
[ "public", "function", "onKernelView", "(", "GetResponseForControllerResultEvent", "$", "event", ")", ":", "void", "{", "$", "controllerResult", "=", "$", "event", "->", "getControllerResult", "(", ")", ";", "$", "request", "=", "$", "event", "->", "getRequest", ...
Creates a Response to send to the client according to the requested format.
[ "Creates", "a", "Response", "to", "send", "to", "the", "client", "according", "to", "the", "requested", "format", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/EventListener/RespondListener.php#L43-L89
train
api-platform/core
src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php
SwaggerUiListener.onKernelRequest
public function onKernelRequest(GetResponseEvent $event): void { $request = $event->getRequest(); if ( 'html' !== $request->getRequestFormat('') || !($request->attributes->has('_api_resource_class') || $request->attributes->getBoolean('_api_respond', false)) ) { ...
php
public function onKernelRequest(GetResponseEvent $event): void { $request = $event->getRequest(); if ( 'html' !== $request->getRequestFormat('') || !($request->attributes->has('_api_resource_class') || $request->attributes->getBoolean('_api_respond', false)) ) { ...
[ "public", "function", "onKernelRequest", "(", "GetResponseEvent", "$", "event", ")", ":", "void", "{", "$", "request", "=", "$", "event", "->", "getRequest", "(", ")", ";", "if", "(", "'html'", "!==", "$", "request", "->", "getRequestFormat", "(", "''", ...
Sets SwaggerUiAction as controller if the requested format is HTML.
[ "Sets", "SwaggerUiAction", "as", "controller", "if", "the", "requested", "format", "is", "HTML", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Bundle/EventListener/SwaggerUiListener.php#L23-L34
train
api-platform/core
features/bootstrap/HydraContext.php
HydraContext.getOperation
private function getOperation(string $method, string $className): stdClass { foreach ($this->getOperations($className) as $operation) { if ($operation->{'hydra:method'} === $method) { return $operation; } } throw new \InvalidArgumentException(sprintf(...
php
private function getOperation(string $method, string $className): stdClass { foreach ($this->getOperations($className) as $operation) { if ($operation->{'hydra:method'} === $method) { return $operation; } } throw new \InvalidArgumentException(sprintf(...
[ "private", "function", "getOperation", "(", "string", "$", "method", ",", "string", "$", "className", ")", ":", "stdClass", "{", "foreach", "(", "$", "this", "->", "getOperations", "(", "$", "className", ")", "as", "$", "operation", ")", "{", "if", "(", ...
Gets an operation by its method name. @throws \InvalidArgumentException
[ "Gets", "an", "operation", "by", "its", "method", "name", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/features/bootstrap/HydraContext.php#L241-L250
train
api-platform/core
src/Util/AnnotationFilterExtractorTrait.php
AnnotationFilterExtractorTrait.getFilterAnnotations
private function getFilterAnnotations(array $miscAnnotations): \Iterator { foreach ($miscAnnotations as $miscAnnotation) { if (ApiFilter::class === \get_class($miscAnnotation)) { yield $miscAnnotation; } } }
php
private function getFilterAnnotations(array $miscAnnotations): \Iterator { foreach ($miscAnnotations as $miscAnnotation) { if (ApiFilter::class === \get_class($miscAnnotation)) { yield $miscAnnotation; } } }
[ "private", "function", "getFilterAnnotations", "(", "array", "$", "miscAnnotations", ")", ":", "\\", "Iterator", "{", "foreach", "(", "$", "miscAnnotations", "as", "$", "miscAnnotation", ")", "{", "if", "(", "ApiFilter", "::", "class", "===", "\\", "get_class"...
Filters annotations to get back only ApiFilter annotations. @param array $miscAnnotations class or property annotations @return \Iterator only ApiFilter annotations
[ "Filters", "annotations", "to", "get", "back", "only", "ApiFilter", "annotations", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/AnnotationFilterExtractorTrait.php#L36-L43
train
api-platform/core
src/Util/AnnotationFilterExtractorTrait.php
AnnotationFilterExtractorTrait.getFilterProperties
private function getFilterProperties(ApiFilter $filterAnnotation, \ReflectionClass $reflectionClass, \ReflectionProperty $reflectionProperty = null): array { $properties = []; if ($filterAnnotation->properties) { foreach ($filterAnnotation->properties as $property => $strategy) { ...
php
private function getFilterProperties(ApiFilter $filterAnnotation, \ReflectionClass $reflectionClass, \ReflectionProperty $reflectionProperty = null): array { $properties = []; if ($filterAnnotation->properties) { foreach ($filterAnnotation->properties as $property => $strategy) { ...
[ "private", "function", "getFilterProperties", "(", "ApiFilter", "$", "filterAnnotation", ",", "\\", "ReflectionClass", "$", "reflectionClass", ",", "\\", "ReflectionProperty", "$", "reflectionProperty", "=", "null", ")", ":", "array", "{", "$", "properties", "=", ...
Given a filter annotation and reflection elements, find out the properties where the filter is applied.
[ "Given", "a", "filter", "annotation", "and", "reflection", "elements", "find", "out", "the", "properties", "where", "the", "filter", "is", "applied", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/AnnotationFilterExtractorTrait.php#L48-L77
train
api-platform/core
src/Util/AnnotationFilterExtractorTrait.php
AnnotationFilterExtractorTrait.readFilterAnnotations
private function readFilterAnnotations(\ReflectionClass $reflectionClass, Reader $reader): array { $filters = []; foreach ($this->getFilterAnnotations($reader->getClassAnnotations($reflectionClass)) as $filterAnnotation) { $filterClass = $filterAnnotation->filterClass; $id =...
php
private function readFilterAnnotations(\ReflectionClass $reflectionClass, Reader $reader): array { $filters = []; foreach ($this->getFilterAnnotations($reader->getClassAnnotations($reflectionClass)) as $filterAnnotation) { $filterClass = $filterAnnotation->filterClass; $id =...
[ "private", "function", "readFilterAnnotations", "(", "\\", "ReflectionClass", "$", "reflectionClass", ",", "Reader", "$", "reader", ")", ":", "array", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getFilterAnnotations", "(", "$...
Reads filter annotations from a ReflectionClass. @return array Key is the filter id. It has two values, properties and the ApiFilter instance
[ "Reads", "filter", "annotations", "from", "a", "ReflectionClass", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/AnnotationFilterExtractorTrait.php#L84-L127
train
api-platform/core
src/Util/AnnotationFilterExtractorTrait.php
AnnotationFilterExtractorTrait.generateFilterId
private function generateFilterId(\ReflectionClass $reflectionClass, string $filterClass, string $filterId = null): string { $suffix = null !== $filterId ? '_'.$filterId : $filterId; return 'annotated_'.Inflector::tableize(str_replace('\\', '', $reflectionClass->getName().(new \ReflectionClass($fil...
php
private function generateFilterId(\ReflectionClass $reflectionClass, string $filterClass, string $filterId = null): string { $suffix = null !== $filterId ? '_'.$filterId : $filterId; return 'annotated_'.Inflector::tableize(str_replace('\\', '', $reflectionClass->getName().(new \ReflectionClass($fil...
[ "private", "function", "generateFilterId", "(", "\\", "ReflectionClass", "$", "reflectionClass", ",", "string", "$", "filterClass", ",", "string", "$", "filterId", "=", "null", ")", ":", "string", "{", "$", "suffix", "=", "null", "!==", "$", "filterId", "?",...
Generates a unique, per-class and per-filter identifier prefixed by `annotated_`. @param \ReflectionClass $reflectionClass the reflection class of a Resource @param string $filterClass the filter class @param string $filterId the filter id
[ "Generates", "a", "unique", "per", "-", "class", "and", "per", "-", "filter", "identifier", "prefixed", "by", "annotated_", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/AnnotationFilterExtractorTrait.php#L136-L141
train
api-platform/core
src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
QueryJoinParser.getClassMetadataFromJoinAlias
public static function getClassMetadataFromJoinAlias(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): ClassMetadata { @trigger_error(sprintf('The use of "%s::getClassMetadataFromJoinAlias()" is deprecated since 2.4 and will be removed in 3.0. Use "%s::getEntityClassByAlias()" in...
php
public static function getClassMetadataFromJoinAlias(string $alias, QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry): ClassMetadata { @trigger_error(sprintf('The use of "%s::getClassMetadataFromJoinAlias()" is deprecated since 2.4 and will be removed in 3.0. Use "%s::getEntityClassByAlias()" in...
[ "public", "static", "function", "getClassMetadataFromJoinAlias", "(", "string", "$", "alias", ",", "QueryBuilder", "$", "queryBuilder", ",", "ManagerRegistry", "$", "managerRegistry", ")", ":", "ClassMetadata", "{", "@", "trigger_error", "(", "sprintf", "(", "'The u...
Gets the class metadata from a given join alias. @deprecated
[ "Gets", "the", "class", "metadata", "from", "a", "given", "join", "alias", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php#L43-L52
train
api-platform/core
src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
QueryJoinParser.getJoinRelationship
public static function getJoinRelationship(Join $join): string { @trigger_error(sprintf('The use of "%s::getJoinRelationship()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getJoin()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED); return $join->getJoin(); }
php
public static function getJoinRelationship(Join $join): string { @trigger_error(sprintf('The use of "%s::getJoinRelationship()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getJoin()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED); return $join->getJoin(); }
[ "public", "static", "function", "getJoinRelationship", "(", "Join", "$", "join", ")", ":", "string", "{", "@", "trigger_error", "(", "sprintf", "(", "'The use of \"%s::getJoinRelationship()\" is deprecated since 2.3 and will be removed in 3.0. Use \"%s::getJoin()\" directly instead...
Gets the relationship from a Join expression. @deprecated
[ "Gets", "the", "relationship", "from", "a", "Join", "expression", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php#L59-L64
train
api-platform/core
src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
QueryJoinParser.getJoinAlias
public static function getJoinAlias(Join $join): string { @trigger_error(sprintf('The use of "%s::getJoinAlias()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getAlias()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED); return $join->getAlias(); }
php
public static function getJoinAlias(Join $join): string { @trigger_error(sprintf('The use of "%s::getJoinAlias()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getAlias()" directly instead.', __CLASS__, Join::class), E_USER_DEPRECATED); return $join->getAlias(); }
[ "public", "static", "function", "getJoinAlias", "(", "Join", "$", "join", ")", ":", "string", "{", "@", "trigger_error", "(", "sprintf", "(", "'The use of \"%s::getJoinAlias()\" is deprecated since 2.3 and will be removed in 3.0. Use \"%s::getAlias()\" directly instead.'", ",", ...
Gets the alias from a Join expression. @deprecated
[ "Gets", "the", "alias", "from", "a", "Join", "expression", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php#L71-L76
train
api-platform/core
src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php
QueryJoinParser.getOrderByParts
public static function getOrderByParts(OrderBy $orderBy): array { @trigger_error(sprintf('The use of "%s::getOrderByParts()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getParts()" directly instead.', __CLASS__, OrderBy::class), E_USER_DEPRECATED); return $orderBy->getParts(); ...
php
public static function getOrderByParts(OrderBy $orderBy): array { @trigger_error(sprintf('The use of "%s::getOrderByParts()" is deprecated since 2.3 and will be removed in 3.0. Use "%s::getParts()" directly instead.', __CLASS__, OrderBy::class), E_USER_DEPRECATED); return $orderBy->getParts(); ...
[ "public", "static", "function", "getOrderByParts", "(", "OrderBy", "$", "orderBy", ")", ":", "array", "{", "@", "trigger_error", "(", "sprintf", "(", "'The use of \"%s::getOrderByParts()\" is deprecated since 2.3 and will be removed in 3.0. Use \"%s::getParts()\" directly instead.'...
Gets the parts from an OrderBy expression. @return string[] @deprecated
[ "Gets", "the", "parts", "from", "an", "OrderBy", "expression", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Util/QueryJoinParser.php#L85-L90
train
api-platform/core
src/Hydra/EventListener/AddLinkHeaderListener.php
AddLinkHeaderListener.onKernelResponse
public function onKernelResponse(FilterResponseEvent $event): void { $apiDocUrl = $this->urlGenerator->generate('api_doc', ['_format' => 'jsonld'], UrlGeneratorInterface::ABS_URL); $link = new Link(ContextBuilder::HYDRA_NS.'apiDocumentation', $apiDocUrl); $attributes = $event->getRequest()-...
php
public function onKernelResponse(FilterResponseEvent $event): void { $apiDocUrl = $this->urlGenerator->generate('api_doc', ['_format' => 'jsonld'], UrlGeneratorInterface::ABS_URL); $link = new Link(ContextBuilder::HYDRA_NS.'apiDocumentation', $apiDocUrl); $attributes = $event->getRequest()-...
[ "public", "function", "onKernelResponse", "(", "FilterResponseEvent", "$", "event", ")", ":", "void", "{", "$", "apiDocUrl", "=", "$", "this", "->", "urlGenerator", "->", "generate", "(", "'api_doc'", ",", "[", "'_format'", "=>", "'jsonld'", "]", ",", "UrlGe...
Sends the Hydra header on each response.
[ "Sends", "the", "Hydra", "header", "on", "each", "response", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/EventListener/AddLinkHeaderListener.php#L39-L51
train
api-platform/core
src/Util/RequestParser.php
RequestParser.parseAndDuplicateRequest
public static function parseAndDuplicateRequest(Request $request): Request { $query = self::parseRequestParams(self::getQueryString($request) ?? ''); $body = self::parseRequestParams($request->getContent()); return $request->duplicate($query, $body); }
php
public static function parseAndDuplicateRequest(Request $request): Request { $query = self::parseRequestParams(self::getQueryString($request) ?? ''); $body = self::parseRequestParams($request->getContent()); return $request->duplicate($query, $body); }
[ "public", "static", "function", "parseAndDuplicateRequest", "(", "Request", "$", "request", ")", ":", "Request", "{", "$", "query", "=", "self", "::", "parseRequestParams", "(", "self", "::", "getQueryString", "(", "$", "request", ")", "??", "''", ")", ";", ...
Gets a fixed request.
[ "Gets", "a", "fixed", "request", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/RequestParser.php#L35-L41
train
api-platform/core
src/Util/RequestParser.php
RequestParser.parseRequestParams
public static function parseRequestParams(string $source): array { // '[' is urlencoded ('%5B') in the input, but we must urldecode it in order // to find it when replacing names with the regexp below. $source = str_replace('%5B', '[', $source); $source = preg_replace_callback( ...
php
public static function parseRequestParams(string $source): array { // '[' is urlencoded ('%5B') in the input, but we must urldecode it in order // to find it when replacing names with the regexp below. $source = str_replace('%5B', '[', $source); $source = preg_replace_callback( ...
[ "public", "static", "function", "parseRequestParams", "(", "string", "$", "source", ")", ":", "array", "{", "// '[' is urlencoded ('%5B') in the input, but we must urldecode it in order", "// to find it when replacing names with the regexp below.", "$", "source", "=", "str_replace"...
Parses request parameters from the specified source. @author Rok Kralj @see https://stackoverflow.com/a/18209799/1529493
[ "Parses", "request", "parameters", "from", "the", "specified", "source", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/RequestParser.php#L50-L68
train
api-platform/core
src/Bridge/Symfony/Routing/RouteNameGenerator.php
RouteNameGenerator.generate
public static function generate(string $operationName, string $resourceShortName, $operationType): string { if (OperationType::SUBRESOURCE === $operationType = OperationTypeDeprecationHelper::getOperationType($operationType)) { throw new InvalidArgumentException('Subresource operations are not s...
php
public static function generate(string $operationName, string $resourceShortName, $operationType): string { if (OperationType::SUBRESOURCE === $operationType = OperationTypeDeprecationHelper::getOperationType($operationType)) { throw new InvalidArgumentException('Subresource operations are not s...
[ "public", "static", "function", "generate", "(", "string", "$", "operationName", ",", "string", "$", "resourceShortName", ",", "$", "operationType", ")", ":", "string", "{", "if", "(", "OperationType", "::", "SUBRESOURCE", "===", "$", "operationType", "=", "Op...
Generates a Symfony route name. @param string|bool $operationType @throws InvalidArgumentException
[ "Generates", "a", "Symfony", "route", "name", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Routing/RouteNameGenerator.php#L43-L56
train
api-platform/core
src/Bridge/Symfony/Routing/RouteNameGenerator.php
RouteNameGenerator.inflector
public static function inflector(string $name, bool $pluralize = true): string { $name = Inflector::tableize($name); return $pluralize ? Inflector::pluralize($name) : $name; }
php
public static function inflector(string $name, bool $pluralize = true): string { $name = Inflector::tableize($name); return $pluralize ? Inflector::pluralize($name) : $name; }
[ "public", "static", "function", "inflector", "(", "string", "$", "name", ",", "bool", "$", "pluralize", "=", "true", ")", ":", "string", "{", "$", "name", "=", "Inflector", "::", "tableize", "(", "$", "name", ")", ";", "return", "$", "pluralize", "?", ...
Transforms a given string to a tableized, pluralized string. @param string $name usually a ResourceMetadata shortname @return string A string that is a part of the route name
[ "Transforms", "a", "given", "string", "to", "a", "tableized", "pluralized", "string", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Routing/RouteNameGenerator.php#L65-L70
train
api-platform/core
src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php
SearchFilterTrait.normalizeValues
protected function normalizeValues(array $values, string $property): ?array { foreach ($values as $key => $value) { if (!\is_int($key) || !\is_string($value)) { unset($values[$key]); } } if (empty($values)) { $this->getLogger()->notice('In...
php
protected function normalizeValues(array $values, string $property): ?array { foreach ($values as $key => $value) { if (!\is_int($key) || !\is_string($value)) { unset($values[$key]); } } if (empty($values)) { $this->getLogger()->notice('In...
[ "protected", "function", "normalizeValues", "(", "array", "$", "values", ",", "string", "$", "property", ")", ":", "?", "array", "{", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "!", "\\", "is_int", "(", ...
Normalize the values array.
[ "Normalize", "the", "values", "array", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php#L133-L150
train
api-platform/core
src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php
SearchFilterTrait.hasValidValues
protected function hasValidValues(array $values, $type = null): bool { foreach ($values as $key => $value) { if (self::DOCTRINE_INTEGER_TYPE === $type && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) { return false; } } return ...
php
protected function hasValidValues(array $values, $type = null): bool { foreach ($values as $key => $value) { if (self::DOCTRINE_INTEGER_TYPE === $type && null !== $value && false === filter_var($value, FILTER_VALIDATE_INT)) { return false; } } return ...
[ "protected", "function", "hasValidValues", "(", "array", "$", "values", ",", "$", "type", "=", "null", ")", ":", "bool", "{", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "self", "::", "DOCTRINE_INTEGER_TYPE...
When the field should be an integer, check that the given value is a valid one. @param mixed|null $type
[ "When", "the", "field", "should", "be", "an", "integer", "check", "that", "the", "given", "value", "is", "a", "valid", "one", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php#L157-L166
train
api-platform/core
src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php
PaginationExtension.shouldDoctrinePaginatorUseOutputWalkers
private function shouldDoctrinePaginatorUseOutputWalkers(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null): bool { if (null !== $resourceClass) { $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass); if (null !== $useOutput...
php
private function shouldDoctrinePaginatorUseOutputWalkers(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null): bool { if (null !== $resourceClass) { $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass); if (null !== $useOutput...
[ "private", "function", "shouldDoctrinePaginatorUseOutputWalkers", "(", "QueryBuilder", "$", "queryBuilder", ",", "string", "$", "resourceClass", "=", "null", ",", "string", "$", "operationName", "=", "null", ")", ":", "bool", "{", "if", "(", "null", "!==", "$", ...
Determines whether the Doctrine ORM Paginator should use output walkers.
[ "Determines", "whether", "the", "Doctrine", "ORM", "Paginator", "should", "use", "output", "walkers", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php#L327-L375
train
api-platform/core
src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php
SearchFilter.addEqualityMatchStrategy
private function addEqualityMatchStrategy(string $strategy, string $field, $value, bool $caseSensitive, ClassMetadata $metadata) { $type = $metadata->getTypeOfField($field); switch ($strategy) { case MongoDbType::STRING !== $type: return MongoDbType::getType($type)->conv...
php
private function addEqualityMatchStrategy(string $strategy, string $field, $value, bool $caseSensitive, ClassMetadata $metadata) { $type = $metadata->getTypeOfField($field); switch ($strategy) { case MongoDbType::STRING !== $type: return MongoDbType::getType($type)->conv...
[ "private", "function", "addEqualityMatchStrategy", "(", "string", "$", "strategy", ",", "string", "$", "field", ",", "$", "value", ",", "bool", "$", "caseSensitive", ",", "ClassMetadata", "$", "metadata", ")", "{", "$", "type", "=", "$", "metadata", "->", ...
Add equality match stage according to the strategy. @throws InvalidArgumentException If strategy does not exist @return Regex|string
[ "Add", "equality", "match", "stage", "according", "to", "the", "strategy", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilter.php#L164-L185
train
api-platform/core
src/Mercure/EventListener/AddLinkHeaderListener.php
AddLinkHeaderListener.onKernelResponse
public function onKernelResponse(FilterResponseEvent $event): void { $link = new Link('mercure', $this->hub); $attributes = $event->getRequest()->attributes; if ( null === ($resourceClass = $attributes->get('_api_resource_class')) || false === $this->resourceMetadata...
php
public function onKernelResponse(FilterResponseEvent $event): void { $link = new Link('mercure', $this->hub); $attributes = $event->getRequest()->attributes; if ( null === ($resourceClass = $attributes->get('_api_resource_class')) || false === $this->resourceMetadata...
[ "public", "function", "onKernelResponse", "(", "FilterResponseEvent", "$", "event", ")", ":", "void", "{", "$", "link", "=", "new", "Link", "(", "'mercure'", ",", "$", "this", "->", "hub", ")", ";", "$", "attributes", "=", "$", "event", "->", "getRequest...
Sends the Mercure header on each response.
[ "Sends", "the", "Mercure", "header", "on", "each", "response", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Mercure/EventListener/AddLinkHeaderListener.php#L40-L59
train
api-platform/core
src/Bridge/Symfony/Routing/IriConverter.php
IriConverter.generateIdentifiersUrl
private function generateIdentifiersUrl(array $identifiers, string $resourceClass): array { if (0 === \count($identifiers)) { throw new InvalidArgumentException(sprintf( 'No identifiers defined for resource of type "%s"', $resourceClass )); } ...
php
private function generateIdentifiersUrl(array $identifiers, string $resourceClass): array { if (0 === \count($identifiers)) { throw new InvalidArgumentException(sprintf( 'No identifiers defined for resource of type "%s"', $resourceClass )); } ...
[ "private", "function", "generateIdentifiersUrl", "(", "array", "$", "identifiers", ",", "string", "$", "resourceClass", ")", ":", "array", "{", "if", "(", "0", "===", "\\", "count", "(", "$", "identifiers", ")", ")", "{", "throw", "new", "InvalidArgumentExce...
Generate the identifier url. @throws InvalidArgumentException @return string[]
[ "Generate", "the", "identifier", "url", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Routing/IriConverter.php#L182-L200
train
api-platform/core
src/Metadata/Extractor/YamlExtractor.php
YamlExtractor.phpize
private function phpize(array $array, string $key, string $type) { if (!isset($array[$key])) { return null; } switch ($type) { case 'bool': if (\is_bool($array[$key])) { return $array[$key]; } break;...
php
private function phpize(array $array, string $key, string $type) { if (!isset($array[$key])) { return null; } switch ($type) { case 'bool': if (\is_bool($array[$key])) { return $array[$key]; } break;...
[ "private", "function", "phpize", "(", "array", "$", "array", ",", "string", "$", "key", ",", "string", "$", "type", ")", "{", "if", "(", "!", "isset", "(", "$", "array", "[", "$", "key", "]", ")", ")", "{", "return", "null", ";", "}", "switch", ...
Transforms a YAML attribute's value in PHP value. @throws InvalidArgumentException @return bool|string|null
[ "Transforms", "a", "YAML", "attribute", "s", "value", "in", "PHP", "value", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Extractor/YamlExtractor.php#L126-L146
train
api-platform/core
src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php
AbstractFilter.getProperties
protected function getProperties(string $resourceClass): \Traversable { if (null !== $this->properties) { return yield from array_keys($this->properties); } try { yield from $this->propertyNameCollectionFactory->create($resourceClass); } catch (ResourceClassN...
php
protected function getProperties(string $resourceClass): \Traversable { if (null !== $this->properties) { return yield from array_keys($this->properties); } try { yield from $this->propertyNameCollectionFactory->create($resourceClass); } catch (ResourceClassN...
[ "protected", "function", "getProperties", "(", "string", "$", "resourceClass", ")", ":", "\\", "Traversable", "{", "if", "(", "null", "!==", "$", "this", "->", "properties", ")", "{", "return", "yield", "from", "array_keys", "(", "$", "this", "->", "proper...
Gets all enabled properties for the given resource class.
[ "Gets", "all", "enabled", "properties", "for", "the", "given", "resource", "class", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php#L52-L62
train
api-platform/core
src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php
AbstractFilter.hasProperty
protected function hasProperty(string $resourceClass, string $property): bool { return \in_array($property, iterator_to_array($this->getProperties($resourceClass)), true); }
php
protected function hasProperty(string $resourceClass, string $property): bool { return \in_array($property, iterator_to_array($this->getProperties($resourceClass)), true); }
[ "protected", "function", "hasProperty", "(", "string", "$", "resourceClass", ",", "string", "$", "property", ")", ":", "bool", "{", "return", "\\", "in_array", "(", "$", "property", ",", "iterator_to_array", "(", "$", "this", "->", "getProperties", "(", "$",...
Is the given property enabled?
[ "Is", "the", "given", "property", "enabled?" ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php#L67-L70
train
api-platform/core
src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php
AbstractFilter.getMetadata
protected function getMetadata(string $resourceClass, string $property): array { $noop = [null, null, null, null]; if (!$this->hasProperty($resourceClass, $property)) { return $noop; } $properties = explode('.', $property); $totalProperties = \count($properties)...
php
protected function getMetadata(string $resourceClass, string $property): array { $noop = [null, null, null, null]; if (!$this->hasProperty($resourceClass, $property)) { return $noop; } $properties = explode('.', $property); $totalProperties = \count($properties)...
[ "protected", "function", "getMetadata", "(", "string", "$", "resourceClass", ",", "string", "$", "property", ")", ":", "array", "{", "$", "noop", "=", "[", "null", ",", "null", ",", "null", ",", "null", "]", ";", "if", "(", "!", "$", "this", "->", ...
Gets info about the decomposed given property for the given resource class. Returns an array with the following info as values: - the {@see Type} of the decomposed given property - is the decomposed given property an association? - the resource class of the decomposed given property - the property name of the decompos...
[ "Gets", "info", "about", "the", "decomposed", "given", "property", "for", "the", "given", "resource", "class", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractFilter.php#L81-L144
train
api-platform/core
src/Util/IriHelper.php
IriHelper.parseIri
public static function parseIri(string $iri, string $pageParameterName): array { $parts = parse_url($iri); if (false === $parts) { throw new InvalidArgumentException(sprintf('The request URI "%s" is malformed.', $iri)); } $parameters = []; if (isset($parts['query...
php
public static function parseIri(string $iri, string $pageParameterName): array { $parts = parse_url($iri); if (false === $parts) { throw new InvalidArgumentException(sprintf('The request URI "%s" is malformed.', $iri)); } $parameters = []; if (isset($parts['query...
[ "public", "static", "function", "parseIri", "(", "string", "$", "iri", ",", "string", "$", "pageParameterName", ")", ":", "array", "{", "$", "parts", "=", "parse_url", "(", "$", "iri", ")", ";", "if", "(", "false", "===", "$", "parts", ")", "{", "thr...
Parses and standardizes the request IRI. @throws InvalidArgumentException
[ "Parses", "and", "standardizes", "the", "request", "IRI", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/IriHelper.php#L36-L52
train
api-platform/core
src/Util/IriHelper.php
IriHelper.createIri
public static function createIri(array $parts, array $parameters, string $pageParameterName = null, float $page = null, bool $absoluteUrl = false): string { if (null !== $page && null !== $pageParameterName) { $parameters[$pageParameterName] = $page; } $query = http_build_query(...
php
public static function createIri(array $parts, array $parameters, string $pageParameterName = null, float $page = null, bool $absoluteUrl = false): string { if (null !== $page && null !== $pageParameterName) { $parameters[$pageParameterName] = $page; } $query = http_build_query(...
[ "public", "static", "function", "createIri", "(", "array", "$", "parts", ",", "array", "$", "parameters", ",", "string", "$", "pageParameterName", "=", "null", ",", "float", "$", "page", "=", "null", ",", "bool", "$", "absoluteUrl", "=", "false", ")", ":...
Gets a collection IRI for the given parameters. @param float $page
[ "Gets", "a", "collection", "IRI", "for", "the", "given", "parameters", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/IriHelper.php#L59-L109
train
api-platform/core
src/Hydra/Serializer/CollectionFiltersNormalizer.php
CollectionFiltersNormalizer.getSearch
private function getSearch(string $resourceClass, array $parts, array $filters): array { $variables = []; $mapping = []; foreach ($filters as $filter) { foreach ($filter->getDescription($resourceClass) as $variable => $data) { $variables[] = $variable; ...
php
private function getSearch(string $resourceClass, array $parts, array $filters): array { $variables = []; $mapping = []; foreach ($filters as $filter) { foreach ($filter->getDescription($resourceClass) as $variable => $data) { $variables[] = $variable; ...
[ "private", "function", "getSearch", "(", "string", "$", "resourceClass", ",", "array", "$", "parts", ",", "array", "$", "filters", ")", ":", "array", "{", "$", "variables", "=", "[", "]", ";", "$", "mapping", "=", "[", "]", ";", "foreach", "(", "$", ...
Returns the content of the Hydra search property. @param FilterInterface[] $filters
[ "Returns", "the", "content", "of", "the", "Hydra", "search", "property", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hydra/Serializer/CollectionFiltersNormalizer.php#L134-L156
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.validateType
protected function validateType(string $attribute, Type $type, $value, string $format = null) { $builtinType = $type->getBuiltinType(); if (Type::BUILTIN_TYPE_FLOAT === $builtinType && null !== $format && false !== strpos($format, 'json')) { $isValid = \is_float($value) || \is_int($value...
php
protected function validateType(string $attribute, Type $type, $value, string $format = null) { $builtinType = $type->getBuiltinType(); if (Type::BUILTIN_TYPE_FLOAT === $builtinType && null !== $format && false !== strpos($format, 'json')) { $isValid = \is_float($value) || \is_int($value...
[ "protected", "function", "validateType", "(", "string", "$", "attribute", ",", "Type", "$", "type", ",", "$", "value", ",", "string", "$", "format", "=", "null", ")", "{", "$", "builtinType", "=", "$", "type", "->", "getBuiltinType", "(", ")", ";", "if...
Validates the type of the value. Allows using integers as floats for JSON formats. @throws InvalidArgumentException
[ "Validates", "the", "type", "of", "the", "value", ".", "Allows", "using", "integers", "as", "floats", "for", "JSON", "formats", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L364-L378
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.denormalizeCollection
protected function denormalizeCollection(string $attribute, PropertyMetadata $propertyMetadata, Type $type, string $className, $value, ?string $format, array $context): array { if (!\is_array($value)) { throw new InvalidArgumentException(sprintf( 'The type of the "%s" attribute m...
php
protected function denormalizeCollection(string $attribute, PropertyMetadata $propertyMetadata, Type $type, string $className, $value, ?string $format, array $context): array { if (!\is_array($value)) { throw new InvalidArgumentException(sprintf( 'The type of the "%s" attribute m...
[ "protected", "function", "denormalizeCollection", "(", "string", "$", "attribute", ",", "PropertyMetadata", "$", "propertyMetadata", ",", "Type", "$", "type", ",", "string", "$", "className", ",", "$", "value", ",", "?", "string", "$", "format", ",", "array", ...
Denormalizes a collection of objects. @throws InvalidArgumentException
[ "Denormalizes", "a", "collection", "of", "objects", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L385-L409
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.denormalizeRelation
protected function denormalizeRelation(string $attributeName, PropertyMetadata $propertyMetadata, string $className, $value, ?string $format, array $context) { if (\is_string($value)) { try { return $this->iriConverter->getItemFromIri($value, $context + ['fetch_data' => true]); ...
php
protected function denormalizeRelation(string $attributeName, PropertyMetadata $propertyMetadata, string $className, $value, ?string $format, array $context) { if (\is_string($value)) { try { return $this->iriConverter->getItemFromIri($value, $context + ['fetch_data' => true]); ...
[ "protected", "function", "denormalizeRelation", "(", "string", "$", "attributeName", ",", "PropertyMetadata", "$", "propertyMetadata", ",", "string", "$", "className", ",", "$", "value", ",", "?", "string", "$", "format", ",", "array", "$", "context", ")", "{"...
Denormalizes a relation. @throws LogicException @throws UnexpectedValueException @return object|null
[ "Denormalizes", "a", "relation", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L419-L468
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.setValue
private function setValue($object, string $attributeName, $value) { try { $this->propertyAccessor->setValue($object, $attributeName, $value); } catch (NoSuchPropertyException $exception) { // Properties not found are ignored } }
php
private function setValue($object, string $attributeName, $value) { try { $this->propertyAccessor->setValue($object, $attributeName, $value); } catch (NoSuchPropertyException $exception) { // Properties not found are ignored } }
[ "private", "function", "setValue", "(", "$", "object", ",", "string", "$", "attributeName", ",", "$", "value", ")", "{", "try", "{", "$", "this", "->", "propertyAccessor", "->", "setValue", "(", "$", "object", ",", "$", "attributeName", ",", "$", "value"...
Sets a value of the object using the PropertyAccess component. @param object $object
[ "Sets", "a", "value", "of", "the", "object", "using", "the", "PropertyAccess", "component", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L475-L482
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.getFactoryOptions
protected function getFactoryOptions(array $context): array { $options = []; if (isset($context[self::GROUPS])) { $options['serializer_groups'] = $context[self::GROUPS]; } if (isset($context['collection_operation_name'])) { $options['collection_operation_nam...
php
protected function getFactoryOptions(array $context): array { $options = []; if (isset($context[self::GROUPS])) { $options['serializer_groups'] = $context[self::GROUPS]; } if (isset($context['collection_operation_name'])) { $options['collection_operation_nam...
[ "protected", "function", "getFactoryOptions", "(", "array", "$", "context", ")", ":", "array", "{", "$", "options", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "context", "[", "self", "::", "GROUPS", "]", ")", ")", "{", "$", "options", "[", "...
Gets a valid context for property metadata factories. @see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php
[ "Gets", "a", "valid", "context", "for", "property", "metadata", "factories", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L489-L506
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.normalizeRelation
protected function normalizeRelation(PropertyMetadata $propertyMetadata, $relatedObject, string $resourceClass, ?string $format, array $context) { if (null === $relatedObject || !empty($context['attributes']) || $propertyMetadata->isReadableLink()) { if (null === $relatedObject) { ...
php
protected function normalizeRelation(PropertyMetadata $propertyMetadata, $relatedObject, string $resourceClass, ?string $format, array $context) { if (null === $relatedObject || !empty($context['attributes']) || $propertyMetadata->isReadableLink()) { if (null === $relatedObject) { ...
[ "protected", "function", "normalizeRelation", "(", "PropertyMetadata", "$", "propertyMetadata", ",", "$", "relatedObject", ",", "string", "$", "resourceClass", ",", "?", "string", "$", "format", ",", "array", "$", "context", ")", "{", "if", "(", "null", "===",...
Normalizes a relation as an object if is a Link or as an URI. @throws LogicException @return string|array
[ "Normalizes", "a", "relation", "as", "an", "object", "if", "is", "a", "Link", "or", "as", "an", "URI", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L593-L618
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.getDataTransformer
protected function getDataTransformer($object, string $to, array $context = []): ?DataTransformerInterface { foreach ($this->dataTransformers as $dataTransformer) { if ($dataTransformer->supportsTransformation($object, $to, $context)) { return $dataTransformer; } ...
php
protected function getDataTransformer($object, string $to, array $context = []): ?DataTransformerInterface { foreach ($this->dataTransformers as $dataTransformer) { if ($dataTransformer->supportsTransformation($object, $to, $context)) { return $dataTransformer; } ...
[ "protected", "function", "getDataTransformer", "(", "$", "object", ",", "string", "$", "to", ",", "array", "$", "context", "=", "[", "]", ")", ":", "?", "DataTransformerInterface", "{", "foreach", "(", "$", "this", "->", "dataTransformers", "as", "$", "dat...
Finds the first supported data transformer if any.
[ "Finds", "the", "first", "supported", "data", "transformer", "if", "any", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L623-L632
train
api-platform/core
src/Serializer/AbstractItemNormalizer.php
AbstractItemNormalizer.transformOutput
protected function transformOutput($object, array $context = []) { $outputClass = $this->getOutputClass($this->getObjectClass($object), $context); if (null !== $outputClass && null !== $dataTransformer = $this->getDataTransformer($object, $outputClass, $context)) { return $dataTransforme...
php
protected function transformOutput($object, array $context = []) { $outputClass = $this->getOutputClass($this->getObjectClass($object), $context); if (null !== $outputClass && null !== $dataTransformer = $this->getDataTransformer($object, $outputClass, $context)) { return $dataTransforme...
[ "protected", "function", "transformOutput", "(", "$", "object", ",", "array", "$", "context", "=", "[", "]", ")", "{", "$", "outputClass", "=", "$", "this", "->", "getOutputClass", "(", "$", "this", "->", "getObjectClass", "(", "$", "object", ")", ",", ...
For a given resource, it returns an output representation if any If not, the resource is returned.
[ "For", "a", "given", "resource", "it", "returns", "an", "output", "representation", "if", "any", "If", "not", "the", "resource", "is", "returned", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Serializer/AbstractItemNormalizer.php#L638-L646
train
api-platform/core
src/Util/AttributesExtractor.php
AttributesExtractor.extractAttributes
public static function extractAttributes(array $attributes): array { $result = ['resource_class' => $attributes['_api_resource_class'] ?? null]; if ($subresourceContext = $attributes['_api_subresource_context'] ?? null) { $result['subresource_context'] = $subresourceContext; } ...
php
public static function extractAttributes(array $attributes): array { $result = ['resource_class' => $attributes['_api_resource_class'] ?? null]; if ($subresourceContext = $attributes['_api_subresource_context'] ?? null) { $result['subresource_context'] = $subresourceContext; } ...
[ "public", "static", "function", "extractAttributes", "(", "array", "$", "attributes", ")", ":", "array", "{", "$", "result", "=", "[", "'resource_class'", "=>", "$", "attributes", "[", "'_api_resource_class'", "]", "??", "null", "]", ";", "if", "(", "$", "...
Extracts resource class, operation name and format request attributes. Returns an empty array if the request does not contain required attributes.
[ "Extracts", "resource", "class", "operation", "name", "and", "format", "request", "attributes", ".", "Returns", "an", "empty", "array", "if", "the", "request", "does", "not", "contain", "required", "attributes", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Util/AttributesExtractor.php#L35-L67
train
api-platform/core
src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php
ValidationExceptionListener.onKernelException
public function onKernelException(GetResponseForExceptionEvent $event): void { $exception = $event->getException(); if (!$exception instanceof ValidationException) { return; } $format = ErrorFormatGuesser::guessErrorFormat($event->getRequest(), $this->errorFormats); ...
php
public function onKernelException(GetResponseForExceptionEvent $event): void { $exception = $event->getException(); if (!$exception instanceof ValidationException) { return; } $format = ErrorFormatGuesser::guessErrorFormat($event->getRequest(), $this->errorFormats); ...
[ "public", "function", "onKernelException", "(", "GetResponseForExceptionEvent", "$", "event", ")", ":", "void", "{", "$", "exception", "=", "$", "event", "->", "getException", "(", ")", ";", "if", "(", "!", "$", "exception", "instanceof", "ValidationException", ...
Returns a list of violations normalized in the Hydra format.
[ "Returns", "a", "list", "of", "violations", "normalized", "in", "the", "Hydra", "format", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php#L41-L59
train
api-platform/core
src/Bridge/Doctrine/Orm/PropertyHelperTrait.php
PropertyHelperTrait.addJoinsForNestedProperty
protected function addJoinsForNestedProperty(string $property, string $rootAlias, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator/*, string $resourceClass, string $joinType*/): array { if (\func_num_args() > 4) { $resourceClass = func_get_arg(4); } else { ...
php
protected function addJoinsForNestedProperty(string $property, string $rootAlias, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator/*, string $resourceClass, string $joinType*/): array { if (\func_num_args() > 4) { $resourceClass = func_get_arg(4); } else { ...
[ "protected", "function", "addJoinsForNestedProperty", "(", "string", "$", "property", ",", "string", "$", "rootAlias", ",", "QueryBuilder", "$", "queryBuilder", ",", "QueryNameGeneratorInterface", "$", "queryNameGenerator", "/*, string $resourceClass, string $joinType*/", ")"...
Adds the necessary joins for a nested property. @throws InvalidArgumentException If property is not nested @return array An array where the first element is the join $alias of the leaf entity, the second element is the $field name the third element is the $associations array
[ "Adds", "the", "necessary", "joins", "for", "a", "nested", "property", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/PropertyHelperTrait.php#L43-L83
train
api-platform/core
src/Bridge/Doctrine/MongoDbOdm/Filter/DateFilter.php
DateFilter.addMatch
private function addMatch(Builder $aggregationBuilder, string $field, string $operator, string $value, string $nullManagement = null): void { try { $value = new \DateTime($value); } catch (\Exception $e) { // Silently ignore this filter if it can not be transformed to a \Date...
php
private function addMatch(Builder $aggregationBuilder, string $field, string $operator, string $value, string $nullManagement = null): void { try { $value = new \DateTime($value); } catch (\Exception $e) { // Silently ignore this filter if it can not be transformed to a \Date...
[ "private", "function", "addMatch", "(", "Builder", "$", "aggregationBuilder", ",", "string", "$", "field", ",", "string", "$", "operator", ",", "string", "$", "value", ",", "string", "$", "nullManagement", "=", "null", ")", ":", "void", "{", "try", "{", ...
Adds the match stage according to the chosen null management.
[ "Adds", "the", "match", "stage", "according", "to", "the", "chosen", "null", "management", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/MongoDbOdm/Filter/DateFilter.php#L110-L143
train
api-platform/core
src/Bridge/Doctrine/Orm/Filter/SearchFilter.php
SearchFilter.addWhereByStrategy
protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, $value, bool $caseSensitive) { $wrapCase = $this->createWrapCase($caseSensitive); $valueParameter = $queryNameGenerator->generateParamete...
php
protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, $value, bool $caseSensitive) { $wrapCase = $this->createWrapCase($caseSensitive); $valueParameter = $queryNameGenerator->generateParamete...
[ "protected", "function", "addWhereByStrategy", "(", "string", "$", "strategy", ",", "QueryBuilder", "$", "queryBuilder", ",", "QueryNameGeneratorInterface", "$", "queryNameGenerator", ",", "string", "$", "alias", ",", "string", "$", "field", ",", "$", "value", ","...
Adds where clause according to the strategy. @throws InvalidArgumentException If strategy does not exist
[ "Adds", "where", "clause", "according", "to", "the", "strategy", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php#L190-L225
train
api-platform/core
src/Bridge/Doctrine/Orm/Filter/SearchFilter.php
SearchFilter.createWrapCase
protected function createWrapCase(bool $caseSensitive): \Closure { return function (string $expr) use ($caseSensitive): string { if ($caseSensitive) { return $expr; } return sprintf('LOWER(%s)', $expr); }; }
php
protected function createWrapCase(bool $caseSensitive): \Closure { return function (string $expr) use ($caseSensitive): string { if ($caseSensitive) { return $expr; } return sprintf('LOWER(%s)', $expr); }; }
[ "protected", "function", "createWrapCase", "(", "bool", "$", "caseSensitive", ")", ":", "\\", "Closure", "{", "return", "function", "(", "string", "$", "expr", ")", "use", "(", "$", "caseSensitive", ")", ":", "string", "{", "if", "(", "$", "caseSensitive",...
Creates a function that will wrap a Doctrine expression according to the specified case sensitivity. For example, "o.name" will get wrapped into "LOWER(o.name)" when $caseSensitive is false.
[ "Creates", "a", "function", "that", "will", "wrap", "a", "Doctrine", "expression", "according", "to", "the", "specified", "case", "sensitivity", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Orm/Filter/SearchFilter.php#L234-L243
train
api-platform/core
src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php
ExtractorPropertyMetadataFactory.createSubresourceMetadata
private function createSubresourceMetadata($subresource, PropertyMetadata $propertyMetadata): ?SubresourceMetadata { if (!$subresource) { return null; } $type = $propertyMetadata->getType(); $maxDepth = \is_array($subresource) ? $subresource['maxDepth'] ?? null : null; ...
php
private function createSubresourceMetadata($subresource, PropertyMetadata $propertyMetadata): ?SubresourceMetadata { if (!$subresource) { return null; } $type = $propertyMetadata->getType(); $maxDepth = \is_array($subresource) ? $subresource['maxDepth'] ?? null : null; ...
[ "private", "function", "createSubresourceMetadata", "(", "$", "subresource", ",", "PropertyMetadata", "$", "propertyMetadata", ")", ":", "?", "SubresourceMetadata", "{", "if", "(", "!", "$", "subresource", ")", "{", "return", "null", ";", "}", "$", "type", "="...
Creates a SubresourceMetadata. @param bool|array|null $subresource the subresource metadata coming from XML or YAML @param PropertyMetadata $propertyMetadata the current property metadata
[ "Creates", "a", "SubresourceMetadata", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php#L131-L151
train
api-platform/core
src/GraphQl/Type/SchemaBuilder.php
SchemaBuilder.getQueryFields
private function getQueryFields(string $resourceClass, ResourceMetadata $resourceMetadata, string $queryName, $itemConfiguration, $collectionConfiguration): array { $queryFields = []; $shortName = $resourceMetadata->getShortName(); $fieldName = lcfirst('query' === $queryName ? $shortName : $...
php
private function getQueryFields(string $resourceClass, ResourceMetadata $resourceMetadata, string $queryName, $itemConfiguration, $collectionConfiguration): array { $queryFields = []; $shortName = $resourceMetadata->getShortName(); $fieldName = lcfirst('query' === $queryName ? $shortName : $...
[ "private", "function", "getQueryFields", "(", "string", "$", "resourceClass", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "queryName", ",", "$", "itemConfiguration", ",", "$", "collectionConfiguration", ")", ":", "array", "{", "$", "query...
Gets the query fields of the schema. @param array|false $itemConfiguration false if not configured @param array|false $collectionConfiguration false if not configured
[ "Gets", "the", "query", "fields", "of", "the", "schema", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/GraphQl/Type/SchemaBuilder.php#L181-L200
train
api-platform/core
src/GraphQl/Type/SchemaBuilder.php
SchemaBuilder.getMutationField
private function getMutationField(string $resourceClass, ResourceMetadata $resourceMetadata, string $mutationName): array { $shortName = $resourceMetadata->getShortName(); $resourceType = new Type(Type::BUILTIN_TYPE_OBJECT, true, $resourceClass); $deprecationReason = $resourceMetadata->getGr...
php
private function getMutationField(string $resourceClass, ResourceMetadata $resourceMetadata, string $mutationName): array { $shortName = $resourceMetadata->getShortName(); $resourceType = new Type(Type::BUILTIN_TYPE_OBJECT, true, $resourceClass); $deprecationReason = $resourceMetadata->getGr...
[ "private", "function", "getMutationField", "(", "string", "$", "resourceClass", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "mutationName", ")", ":", "array", "{", "$", "shortName", "=", "$", "resourceMetadata", "->", "getShortName", "(",...
Gets the mutation field for the given operation name.
[ "Gets", "the", "mutation", "field", "for", "the", "given", "operation", "name", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/GraphQl/Type/SchemaBuilder.php#L205-L220
train
api-platform/core
src/GraphQl/Type/SchemaBuilder.php
SchemaBuilder.convertType
private function convertType(Type $type, bool $input, ?string $queryName, ?string $mutationName, int $depth = 0) { switch ($builtinType = $type->getBuiltinType()) { case Type::BUILTIN_TYPE_BOOL: $graphqlType = GraphQLType::boolean(); break; case Type::...
php
private function convertType(Type $type, bool $input, ?string $queryName, ?string $mutationName, int $depth = 0) { switch ($builtinType = $type->getBuiltinType()) { case Type::BUILTIN_TYPE_BOOL: $graphqlType = GraphQLType::boolean(); break; case Type::...
[ "private", "function", "convertType", "(", "Type", "$", "type", ",", "bool", "$", "input", ",", "?", "string", "$", "queryName", ",", "?", "string", "$", "mutationName", ",", "int", "$", "depth", "=", "0", ")", "{", "switch", "(", "$", "builtinType", ...
Converts a built-in type to its GraphQL equivalent. @throws InvalidTypeException
[ "Converts", "a", "built", "-", "in", "type", "to", "its", "GraphQL", "equivalent", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/GraphQl/Type/SchemaBuilder.php#L374-L425
train
api-platform/core
src/GraphQl/Type/SchemaBuilder.php
SchemaBuilder.getResourceObjectTypeFields
private function getResourceObjectTypeFields(?string $resourceClass, ResourceMetadata $resourceMetadata, bool $input, ?string $queryName, ?string $mutationName, int $depth = 0, ?array $ioMetadata = null): array { $fields = []; $idField = ['type' => GraphQLType::nonNull(GraphQLType::id())]; $...
php
private function getResourceObjectTypeFields(?string $resourceClass, ResourceMetadata $resourceMetadata, bool $input, ?string $queryName, ?string $mutationName, int $depth = 0, ?array $ioMetadata = null): array { $fields = []; $idField = ['type' => GraphQLType::nonNull(GraphQLType::id())]; $...
[ "private", "function", "getResourceObjectTypeFields", "(", "?", "string", "$", "resourceClass", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "bool", "$", "input", ",", "?", "string", "$", "queryName", ",", "?", "string", "$", "mutationName", ",", "int"...
Gets the fields of the type of the given resource.
[ "Gets", "the", "fields", "of", "the", "type", "of", "the", "given", "resource", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/GraphQl/Type/SchemaBuilder.php#L493-L553
train
api-platform/core
src/GraphQl/Type/SchemaBuilder.php
SchemaBuilder.getResourcePaginatedCollectionType
private function getResourcePaginatedCollectionType(GraphQLType $resourceType): GraphQLType { $shortName = $resourceType->name; if (isset($this->graphqlTypes["{$shortName}Connection"])) { return $this->graphqlTypes["{$shortName}Connection"]; } $edgeObjectTypeConfigurati...
php
private function getResourcePaginatedCollectionType(GraphQLType $resourceType): GraphQLType { $shortName = $resourceType->name; if (isset($this->graphqlTypes["{$shortName}Connection"])) { return $this->graphqlTypes["{$shortName}Connection"]; } $edgeObjectTypeConfigurati...
[ "private", "function", "getResourcePaginatedCollectionType", "(", "GraphQLType", "$", "resourceType", ")", ":", "GraphQLType", "{", "$", "shortName", "=", "$", "resourceType", "->", "name", ";", "if", "(", "isset", "(", "$", "this", "->", "graphqlTypes", "[", ...
Gets the type of a paginated collection of the given resource type. @param ObjectType $resourceType @return ObjectType
[ "Gets", "the", "type", "of", "a", "paginated", "collection", "of", "the", "given", "resource", "type", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/GraphQl/Type/SchemaBuilder.php#L562-L605
train
api-platform/core
src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
ApiPlatformProvider.getApiDoc
private function getApiDoc(bool $collection, string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $resourceHydraDoc, array $entrypointHydraDoc = []): ApiDoc { if ($collection) { $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceCla...
php
private function getApiDoc(bool $collection, string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $resourceHydraDoc, array $entrypointHydraDoc = []): ApiDoc { if ($collection) { $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceCla...
[ "private", "function", "getApiDoc", "(", "bool", "$", "collection", ",", "string", "$", "resourceClass", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "operationName", ",", "array", "$", "resourceHydraDoc", ",", "array", "$", "entrypointHyd...
Builds ApiDoc annotation from ApiPlatform data.
[ "Builds", "ApiDoc", "annotation", "from", "ApiPlatform", "data", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php#L106-L150
train
api-platform/core
src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
ApiPlatformProvider.getResourceHydraDoc
private function getResourceHydraDoc(array $hydraApiDoc, string $prefixedShortName): ?array { if (!isset($hydraApiDoc['hydra:supportedClass']) || !\is_array($hydraApiDoc['hydra:supportedClass'])) { return null; } foreach ($hydraApiDoc['hydra:supportedClass'] as $supportedClass) ...
php
private function getResourceHydraDoc(array $hydraApiDoc, string $prefixedShortName): ?array { if (!isset($hydraApiDoc['hydra:supportedClass']) || !\is_array($hydraApiDoc['hydra:supportedClass'])) { return null; } foreach ($hydraApiDoc['hydra:supportedClass'] as $supportedClass) ...
[ "private", "function", "getResourceHydraDoc", "(", "array", "$", "hydraApiDoc", ",", "string", "$", "prefixedShortName", ")", ":", "?", "array", "{", "if", "(", "!", "isset", "(", "$", "hydraApiDoc", "[", "'hydra:supportedClass'", "]", ")", "||", "!", "\\", ...
Gets Hydra documentation for the given resource.
[ "Gets", "Hydra", "documentation", "for", "the", "given", "resource", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php#L155-L168
train
api-platform/core
src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
ApiPlatformProvider.getOperationHydraDoc
private function getOperationHydraDoc(string $method, array $hydraDoc): array { if (!isset($hydraDoc['hydra:supportedOperation']) || !\is_array($hydraDoc['hydra:supportedOperation'])) { return []; } foreach ($hydraDoc['hydra:supportedOperation'] as $supportedOperation) { ...
php
private function getOperationHydraDoc(string $method, array $hydraDoc): array { if (!isset($hydraDoc['hydra:supportedOperation']) || !\is_array($hydraDoc['hydra:supportedOperation'])) { return []; } foreach ($hydraDoc['hydra:supportedOperation'] as $supportedOperation) { ...
[ "private", "function", "getOperationHydraDoc", "(", "string", "$", "method", ",", "array", "$", "hydraDoc", ")", ":", "array", "{", "if", "(", "!", "isset", "(", "$", "hydraDoc", "[", "'hydra:supportedOperation'", "]", ")", "||", "!", "\\", "is_array", "("...
Gets the Hydra documentation of a given operation.
[ "Gets", "the", "Hydra", "documentation", "of", "a", "given", "operation", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php#L173-L186
train
api-platform/core
src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php
ApiPlatformProvider.getCollectionOperationHydraDoc
private function getCollectionOperationHydraDoc(string $shortName, string $method, array $hydraEntrypointDoc): array { if (!isset($hydraEntrypointDoc['hydra:supportedProperty']) || !\is_array($hydraEntrypointDoc['hydra:supportedProperty'])) { return []; } $propertyName = '#Entry...
php
private function getCollectionOperationHydraDoc(string $shortName, string $method, array $hydraEntrypointDoc): array { if (!isset($hydraEntrypointDoc['hydra:supportedProperty']) || !\is_array($hydraEntrypointDoc['hydra:supportedProperty'])) { return []; } $propertyName = '#Entry...
[ "private", "function", "getCollectionOperationHydraDoc", "(", "string", "$", "shortName", ",", "string", "$", "method", ",", "array", "$", "hydraEntrypointDoc", ")", ":", "array", "{", "if", "(", "!", "isset", "(", "$", "hydraEntrypointDoc", "[", "'hydra:support...
Gets the Hydra documentation for the collection operation.
[ "Gets", "the", "Hydra", "documentation", "for", "the", "collection", "operation", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Extractor/AnnotationsProvider/ApiPlatformProvider.php#L191-L207
train
api-platform/core
src/Hal/Serializer/ItemNormalizer.php
ItemNormalizer.populateRelation
private function populateRelation(array $data, $object, ?string $format, array $context, array $components, string $type): array { $class = $this->getObjectClass($object); $attributesMetadata = \array_key_exists($class, $this->attributesMetadataCache) ? $this->attributesMetadataCache[$c...
php
private function populateRelation(array $data, $object, ?string $format, array $context, array $components, string $type): array { $class = $this->getObjectClass($object); $attributesMetadata = \array_key_exists($class, $this->attributesMetadataCache) ? $this->attributesMetadataCache[$c...
[ "private", "function", "populateRelation", "(", "array", "$", "data", ",", "$", "object", ",", "?", "string", "$", "format", ",", "array", "$", "context", ",", "array", "$", "components", ",", "string", "$", "type", ")", ":", "array", "{", "$", "class"...
Populates _links and _embedded keys. @param object $object
[ "Populates", "_links", "and", "_embedded", "keys", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hal/Serializer/ItemNormalizer.php#L175-L221
train
api-platform/core
src/Hal/Serializer/ItemNormalizer.php
ItemNormalizer.getRelationIri
private function getRelationIri($rel): string { if (!(\is_array($rel) || \is_string($rel))) { throw new UnexpectedValueException('Expected relation to be an IRI or array'); } return \is_string($rel) ? $rel : $rel['_links']['self']['href']; }
php
private function getRelationIri($rel): string { if (!(\is_array($rel) || \is_string($rel))) { throw new UnexpectedValueException('Expected relation to be an IRI or array'); } return \is_string($rel) ? $rel : $rel['_links']['self']['href']; }
[ "private", "function", "getRelationIri", "(", "$", "rel", ")", ":", "string", "{", "if", "(", "!", "(", "\\", "is_array", "(", "$", "rel", ")", "||", "\\", "is_string", "(", "$", "rel", ")", ")", ")", "{", "throw", "new", "UnexpectedValueException", ...
Gets the IRI of the given relation. @throws UnexpectedValueException
[ "Gets", "the", "IRI", "of", "the", "given", "relation", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Hal/Serializer/ItemNormalizer.php#L228-L235
train
api-platform/core
src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php
SerializerPropertyMetadataFactory.getPropertySerializerGroups
private function getPropertySerializerGroups(string $resourceClass, string $property): array { $serializerClassMetadata = $this->serializerClassMetadataFactory->getMetadataFor($resourceClass); foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) { ...
php
private function getPropertySerializerGroups(string $resourceClass, string $property): array { $serializerClassMetadata = $this->serializerClassMetadataFactory->getMetadataFor($resourceClass); foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) { ...
[ "private", "function", "getPropertySerializerGroups", "(", "string", "$", "resourceClass", ",", "string", "$", "property", ")", ":", "array", "{", "$", "serializerClassMetadata", "=", "$", "this", "->", "serializerClassMetadataFactory", "->", "getMetadataFor", "(", ...
Gets the serializer groups defined on a property. @return string[]
[ "Gets", "the", "serializer", "groups", "defined", "on", "a", "property", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php#L178-L189
train
api-platform/core
src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php
SerializerPropertyMetadataFactory.getResourceSerializerGroups
private function getResourceSerializerGroups(string $resourceClass): array { $serializerClassMetadata = $this->serializerClassMetadataFactory->getMetadataFor($resourceClass); $groups = []; foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) { ...
php
private function getResourceSerializerGroups(string $resourceClass): array { $serializerClassMetadata = $this->serializerClassMetadataFactory->getMetadataFor($resourceClass); $groups = []; foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) { ...
[ "private", "function", "getResourceSerializerGroups", "(", "string", "$", "resourceClass", ")", ":", "array", "{", "$", "serializerClassMetadata", "=", "$", "this", "->", "serializerClassMetadataFactory", "->", "getMetadataFor", "(", "$", "resourceClass", ")", ";", ...
Gets the serializer groups defined in a resource. @return string[]
[ "Gets", "the", "serializer", "groups", "defined", "in", "a", "resource", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/Factory/SerializerPropertyMetadataFactory.php#L196-L206
train
api-platform/core
src/Bridge/Doctrine/EventListener/WriteListener.php
WriteListener.getManager
private function getManager(string $resourceClass, $data): ?ObjectManager { $objectManager = $this->managerRegistry->getManagerForClass($resourceClass); if (null === $objectManager || !\is_object($data)) { return null; } return $objectManager; }
php
private function getManager(string $resourceClass, $data): ?ObjectManager { $objectManager = $this->managerRegistry->getManagerForClass($resourceClass); if (null === $objectManager || !\is_object($data)) { return null; } return $objectManager; }
[ "private", "function", "getManager", "(", "string", "$", "resourceClass", ",", "$", "data", ")", ":", "?", "ObjectManager", "{", "$", "objectManager", "=", "$", "this", "->", "managerRegistry", "->", "getManagerForClass", "(", "$", "resourceClass", ")", ";", ...
Gets the manager if applicable.
[ "Gets", "the", "manager", "if", "applicable", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/WriteListener.php#L75-L83
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withType
public function withType(Type $type): self { $metadata = clone $this; $metadata->type = $type; return $metadata; }
php
public function withType(Type $type): self { $metadata = clone $this; $metadata->type = $type; return $metadata; }
[ "public", "function", "withType", "(", "Type", "$", "type", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "type", "=", "$", "type", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given type.
[ "Returns", "a", "new", "instance", "with", "the", "given", "type", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L67-L73
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withDescription
public function withDescription(string $description): self { $metadata = clone $this; $metadata->description = $description; return $metadata; }
php
public function withDescription(string $description): self { $metadata = clone $this; $metadata->description = $description; return $metadata; }
[ "public", "function", "withDescription", "(", "string", "$", "description", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "description", "=", "$", "description", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given description.
[ "Returns", "a", "new", "instance", "with", "the", "given", "description", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L86-L92
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withReadable
public function withReadable(bool $readable): self { $metadata = clone $this; $metadata->readable = $readable; return $metadata; }
php
public function withReadable(bool $readable): self { $metadata = clone $this; $metadata->readable = $readable; return $metadata; }
[ "public", "function", "withReadable", "(", "bool", "$", "readable", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "readable", "=", "$", "readable", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance of Metadata with the given readable flag.
[ "Returns", "a", "new", "instance", "of", "Metadata", "with", "the", "given", "readable", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L105-L111
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withWritable
public function withWritable(bool $writable): self { $metadata = clone $this; $metadata->writable = $writable; return $metadata; }
php
public function withWritable(bool $writable): self { $metadata = clone $this; $metadata->writable = $writable; return $metadata; }
[ "public", "function", "withWritable", "(", "bool", "$", "writable", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "writable", "=", "$", "writable", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given writable flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "writable", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L124-L130
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withRequired
public function withRequired(bool $required): self { $metadata = clone $this; $metadata->required = $required; return $metadata; }
php
public function withRequired(bool $required): self { $metadata = clone $this; $metadata->required = $required; return $metadata; }
[ "public", "function", "withRequired", "(", "bool", "$", "required", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "required", "=", "$", "required", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given required flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "required", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L147-L153
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withWritableLink
public function withWritableLink(bool $writableLink): self { $metadata = clone $this; $metadata->writableLink = $writableLink; return $metadata; }
php
public function withWritableLink(bool $writableLink): self { $metadata = clone $this; $metadata->writableLink = $writableLink; return $metadata; }
[ "public", "function", "withWritableLink", "(", "bool", "$", "writableLink", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "writableLink", "=", "$", "writableLink", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given writable link flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "writable", "link", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L166-L172
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withReadableLink
public function withReadableLink(bool $readableLink): self { $metadata = clone $this; $metadata->readableLink = $readableLink; return $metadata; }
php
public function withReadableLink(bool $readableLink): self { $metadata = clone $this; $metadata->readableLink = $readableLink; return $metadata; }
[ "public", "function", "withReadableLink", "(", "bool", "$", "readableLink", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "readableLink", "=", "$", "readableLink", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given readable link flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "readable", "link", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L185-L191
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withIdentifier
public function withIdentifier(bool $identifier): self { $metadata = clone $this; $metadata->identifier = $identifier; return $metadata; }
php
public function withIdentifier(bool $identifier): self { $metadata = clone $this; $metadata->identifier = $identifier; return $metadata; }
[ "public", "function", "withIdentifier", "(", "bool", "$", "identifier", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "identifier", "=", "$", "identifier", ";", "return", "$", "metadata", ";", "}" ]
Returns a new instance with the given identifier flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "identifier", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L223-L229
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withChildInherited
public function withChildInherited(string $childInherited): self { $metadata = clone $this; $metadata->childInherited = $childInherited; return $metadata; }
php
public function withChildInherited(string $childInherited): self { $metadata = clone $this; $metadata->childInherited = $childInherited; return $metadata; }
[ "public", "function", "withChildInherited", "(", "string", "$", "childInherited", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "childInherited", "=", "$", "childInherited", ";", "return", "$", "metadata", ";"...
Returns a new instance with the given child inherited class.
[ "Returns", "a", "new", "instance", "with", "the", "given", "child", "inherited", "class", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L291-L297
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withSubresource
public function withSubresource(SubresourceMetadata $subresource = null): self { $metadata = clone $this; $metadata->subresource = $subresource; return $metadata; }
php
public function withSubresource(SubresourceMetadata $subresource = null): self { $metadata = clone $this; $metadata->subresource = $subresource; return $metadata; }
[ "public", "function", "withSubresource", "(", "SubresourceMetadata", "$", "subresource", "=", "null", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "subresource", "=", "$", "subresource", ";", "return", "$", ...
Returns a new instance with the given subresource. @param SubresourceMetadata $subresource
[ "Returns", "a", "new", "instance", "with", "the", "given", "subresource", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L320-L326
train
api-platform/core
src/Metadata/Property/PropertyMetadata.php
PropertyMetadata.withInitializable
public function withInitializable(bool $initializable): self { $metadata = clone $this; $metadata->initializable = $initializable; return $metadata; }
php
public function withInitializable(bool $initializable): self { $metadata = clone $this; $metadata->initializable = $initializable; return $metadata; }
[ "public", "function", "withInitializable", "(", "bool", "$", "initializable", ")", ":", "self", "{", "$", "metadata", "=", "clone", "$", "this", ";", "$", "metadata", "->", "initializable", "=", "$", "initializable", ";", "return", "$", "metadata", ";", "}...
Returns a new instance with the given initializable flag.
[ "Returns", "a", "new", "instance", "with", "the", "given", "initializable", "flag", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Metadata/Property/PropertyMetadata.php#L339-L345
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.addPaths
private function addPaths(bool $v3, \ArrayObject $paths, \ArrayObject $definitions, string $resourceClass, string $resourceShortName, ResourceMetadata $resourceMetadata, array $mimeTypes, string $operationType, \ArrayObject $links) { if (null === $operations = OperationType::COLLECTION === $operationType ? ...
php
private function addPaths(bool $v3, \ArrayObject $paths, \ArrayObject $definitions, string $resourceClass, string $resourceShortName, ResourceMetadata $resourceMetadata, array $mimeTypes, string $operationType, \ArrayObject $links) { if (null === $operations = OperationType::COLLECTION === $operationType ? ...
[ "private", "function", "addPaths", "(", "bool", "$", "v3", ",", "\\", "ArrayObject", "$", "paths", ",", "\\", "ArrayObject", "$", "definitions", ",", "string", "$", "resourceClass", ",", "string", "$", "resourceShortName", ",", "ResourceMetadata", "$", "resour...
Updates the list of entries in the paths collection.
[ "Updates", "the", "list", "of", "entries", "in", "the", "paths", "collection", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L167-L179
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getPath
private function getPath(string $resourceShortName, string $operationName, array $operation, string $operationType): string { $path = $this->operationPathResolver->resolveOperationPath($resourceShortName, $operation, $operationType, $operationName); if ('.{_format}' === substr($path, -10)) { ...
php
private function getPath(string $resourceShortName, string $operationName, array $operation, string $operationType): string { $path = $this->operationPathResolver->resolveOperationPath($resourceShortName, $operation, $operationType, $operationName); if ('.{_format}' === substr($path, -10)) { ...
[ "private", "function", "getPath", "(", "string", "$", "resourceShortName", ",", "string", "$", "operationName", ",", "array", "$", "operation", ",", "string", "$", "operationType", ")", ":", "string", "{", "$", "path", "=", "$", "this", "->", "operationPathR...
Gets the path for an operation. If the path ends with the optional _format parameter, it is removed as optional path parameters are not yet supported. @see https://github.com/OAI/OpenAPI-Specification/issues/93
[ "Gets", "the", "path", "for", "an", "operation", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L189-L197
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getPathOperation
private function getPathOperation(bool $v3, string $operationName, array $operation, string $method, string $operationType, string $resourceClass, ResourceMetadata $resourceMetadata, array $mimeTypes, \ArrayObject $definitions, \ArrayObject $links): \ArrayObject { $pathOperation = new \ArrayObject($operatio...
php
private function getPathOperation(bool $v3, string $operationName, array $operation, string $method, string $operationType, string $resourceClass, ResourceMetadata $resourceMetadata, array $mimeTypes, \ArrayObject $definitions, \ArrayObject $links): \ArrayObject { $pathOperation = new \ArrayObject($operatio...
[ "private", "function", "getPathOperation", "(", "bool", "$", "v3", ",", "string", "$", "operationName", ",", "array", "$", "operation", ",", "string", "$", "method", ",", "string", "$", "operationType", ",", "string", "$", "resourceClass", ",", "ResourceMetada...
Gets a path Operation Object. @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operation-object @param string[] $mimeTypes
[ "Gets", "a", "path", "Operation", "Object", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L206-L237
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getDefinitionSchema
private function getDefinitionSchema(bool $v3, string $resourceClass, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject { $definitionSchema = new \ArrayObject(['type' => 'object']); if (null !== $description = $resourceMetadata->getDescrip...
php
private function getDefinitionSchema(bool $v3, string $resourceClass, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject { $definitionSchema = new \ArrayObject(['type' => 'object']); if (null !== $description = $resourceMetadata->getDescrip...
[ "private", "function", "getDefinitionSchema", "(", "bool", "$", "v3", ",", "string", "$", "resourceClass", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "\\", "ArrayObject", "$", "definitions", ",", "array", "$", "serializerContext", "=", "null", ")", "...
Gets a definition Schema Object. @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject
[ "Gets", "a", "definition", "Schema", "Object", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L591-L615
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getPropertySchema
private function getPropertySchema(bool $v3, PropertyMetadata $propertyMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject { $propertySchema = new \ArrayObject($propertyMetadata->getAttributes()[$v3 ? 'openapi_context' : 'swagger_context'] ?? []); if (false === $prop...
php
private function getPropertySchema(bool $v3, PropertyMetadata $propertyMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject { $propertySchema = new \ArrayObject($propertyMetadata->getAttributes()[$v3 ? 'openapi_context' : 'swagger_context'] ?? []); if (false === $prop...
[ "private", "function", "getPropertySchema", "(", "bool", "$", "v3", ",", "PropertyMetadata", "$", "propertyMetadata", ",", "\\", "ArrayObject", "$", "definitions", ",", "array", "$", "serializerContext", "=", "null", ")", ":", "\\", "ArrayObject", "{", "$", "p...
Gets a property Schema Object. @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject
[ "Gets", "a", "property", "Schema", "Object", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L622-L650
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getType
private function getType(bool $v3, string $type, bool $isCollection, ?string $className, ?bool $readableLink, \ArrayObject $definitions, array $serializerContext = null): array { if ($isCollection) { return ['type' => 'array', 'items' => $this->getType($v3, $type, false, $className, $readableLin...
php
private function getType(bool $v3, string $type, bool $isCollection, ?string $className, ?bool $readableLink, \ArrayObject $definitions, array $serializerContext = null): array { if ($isCollection) { return ['type' => 'array', 'items' => $this->getType($v3, $type, false, $className, $readableLin...
[ "private", "function", "getType", "(", "bool", "$", "v3", ",", "string", "$", "type", ",", "bool", "$", "isCollection", ",", "?", "string", "$", "className", ",", "?", "bool", "$", "readableLink", ",", "\\", "ArrayObject", "$", "definitions", ",", "array...
Gets the Swagger's type corresponding to the given PHP's type.
[ "Gets", "the", "Swagger", "s", "type", "corresponding", "to", "the", "given", "PHP", "s", "type", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L655-L701
train
api-platform/core
src/Swagger/Serializer/DocumentationNormalizer.php
DocumentationNormalizer.getFiltersParameters
private function getFiltersParameters(bool $v3, string $resourceClass, string $operationName, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): array { if (null === $this->filterLocator) { return []; } $parameters = []; $res...
php
private function getFiltersParameters(bool $v3, string $resourceClass, string $operationName, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): array { if (null === $this->filterLocator) { return []; } $parameters = []; $res...
[ "private", "function", "getFiltersParameters", "(", "bool", "$", "v3", ",", "string", "$", "resourceClass", ",", "string", "$", "operationName", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "\\", "ArrayObject", "$", "definitions", ",", "array", "$", "s...
Gets parameters corresponding to enabled filters.
[ "Gets", "parameters", "corresponding", "to", "enabled", "filters", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Swagger/Serializer/DocumentationNormalizer.php#L790-L834
train
api-platform/core
src/Bridge/Symfony/Routing/ApiLoader.php
ApiLoader.loadExternalFiles
private function loadExternalFiles(RouteCollection $routeCollection): void { if ($this->entrypointEnabled) { $routeCollection->addCollection($this->fileLoader->load('api.xml')); } if ($this->docsEnabled) { $routeCollection->addCollection($this->fileLoader->load('docs...
php
private function loadExternalFiles(RouteCollection $routeCollection): void { if ($this->entrypointEnabled) { $routeCollection->addCollection($this->fileLoader->load('api.xml')); } if ($this->docsEnabled) { $routeCollection->addCollection($this->fileLoader->load('docs...
[ "private", "function", "loadExternalFiles", "(", "RouteCollection", "$", "routeCollection", ")", ":", "void", "{", "if", "(", "$", "this", "->", "entrypointEnabled", ")", "{", "$", "routeCollection", "->", "addCollection", "(", "$", "this", "->", "fileLoader", ...
Load external files.
[ "Load", "external", "files", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Routing/ApiLoader.php#L158-L177
train
api-platform/core
src/Bridge/Symfony/Routing/ApiLoader.php
ApiLoader.addRoute
private function addRoute(RouteCollection $routeCollection, string $resourceClass, string $operationName, array $operation, ResourceMetadata $resourceMetadata, string $operationType): void { $resourceShortName = $resourceMetadata->getShortName(); if (isset($operation['route_name'])) { r...
php
private function addRoute(RouteCollection $routeCollection, string $resourceClass, string $operationName, array $operation, ResourceMetadata $resourceMetadata, string $operationType): void { $resourceShortName = $resourceMetadata->getShortName(); if (isset($operation['route_name'])) { r...
[ "private", "function", "addRoute", "(", "RouteCollection", "$", "routeCollection", ",", "string", "$", "resourceClass", ",", "string", "$", "operationName", ",", "array", "$", "operation", ",", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "oper...
Creates and adds a route for the given operation to the route collection. @throws RuntimeException
[ "Creates", "and", "adds", "a", "route", "for", "the", "given", "operation", "to", "the", "route", "collection", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Symfony/Routing/ApiLoader.php#L184-L224
train
api-platform/core
src/Bridge/Doctrine/Common/PropertyHelperTrait.php
PropertyHelperTrait.isPropertyMapped
protected function isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation = false): bool { if ($this->isPropertyNested($property, $resourceClass)) { $propertyParts = $this->splitPropertyParts($property, $resourceClass); $metadata = $this->getNestedMetadata($...
php
protected function isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation = false): bool { if ($this->isPropertyNested($property, $resourceClass)) { $propertyParts = $this->splitPropertyParts($property, $resourceClass); $metadata = $this->getNestedMetadata($...
[ "protected", "function", "isPropertyMapped", "(", "string", "$", "property", ",", "string", "$", "resourceClass", ",", "bool", "$", "allowAssociation", "=", "false", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "isPropertyNested", "(", "$", "property...
Determines whether the given property is mapped.
[ "Determines", "whether", "the", "given", "property", "is", "mapped", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/PropertyHelperTrait.php#L34-L45
train
api-platform/core
src/Bridge/Doctrine/Common/PropertyHelperTrait.php
PropertyHelperTrait.isPropertyNested
protected function isPropertyNested(string $property/*, string $resourceClass*/): bool { if (\func_num_args() > 1) { $resourceClass = (string) func_get_arg(1); } else { if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); ...
php
protected function isPropertyNested(string $property/*, string $resourceClass*/): bool { if (\func_num_args() > 1) { $resourceClass = (string) func_get_arg(1); } else { if (__CLASS__ !== \get_class($this)) { $r = new \ReflectionMethod($this, __FUNCTION__); ...
[ "protected", "function", "isPropertyNested", "(", "string", "$", "property", "/*, string $resourceClass*/", ")", ":", "bool", "{", "if", "(", "\\", "func_num_args", "(", ")", ">", "1", ")", "{", "$", "resourceClass", "=", "(", "string", ")", "func_get_arg", ...
Determines whether the given property is nested.
[ "Determines", "whether", "the", "given", "property", "is", "nested", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/PropertyHelperTrait.php#L50-L70
train
api-platform/core
src/Bridge/Doctrine/Common/PropertyHelperTrait.php
PropertyHelperTrait.isPropertyEmbedded
protected function isPropertyEmbedded(string $property, string $resourceClass): bool { return false !== strpos($property, '.') && $this->getClassMetadata($resourceClass)->hasField($property); }
php
protected function isPropertyEmbedded(string $property, string $resourceClass): bool { return false !== strpos($property, '.') && $this->getClassMetadata($resourceClass)->hasField($property); }
[ "protected", "function", "isPropertyEmbedded", "(", "string", "$", "property", ",", "string", "$", "resourceClass", ")", ":", "bool", "{", "return", "false", "!==", "strpos", "(", "$", "property", ",", "'.'", ")", "&&", "$", "this", "->", "getClassMetadata",...
Determines whether the given property is embedded.
[ "Determines", "whether", "the", "given", "property", "is", "embedded", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/PropertyHelperTrait.php#L75-L78
train
api-platform/core
src/Bridge/Doctrine/Common/PropertyHelperTrait.php
PropertyHelperTrait.splitPropertyParts
protected function splitPropertyParts(string $property/*, string $resourceClass*/): array { $resourceClass = null; $parts = explode('.', $property); if (\func_num_args() > 1) { $resourceClass = func_get_arg(1); } elseif (__CLASS__ !== \get_class($this)) { $r ...
php
protected function splitPropertyParts(string $property/*, string $resourceClass*/): array { $resourceClass = null; $parts = explode('.', $property); if (\func_num_args() > 1) { $resourceClass = func_get_arg(1); } elseif (__CLASS__ !== \get_class($this)) { $r ...
[ "protected", "function", "splitPropertyParts", "(", "string", "$", "property", "/*, string $resourceClass*/", ")", ":", "array", "{", "$", "resourceClass", "=", "null", ";", "$", "parts", "=", "explode", "(", "'.'", ",", "$", "property", ")", ";", "if", "(",...
Splits the given property into parts. Returns an array with the following keys: - associations: array of associations according to nesting order - field: string holding the actual field (leaf node)
[ "Splits", "the", "given", "property", "into", "parts", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/PropertyHelperTrait.php#L87-L126
train
api-platform/core
src/Bridge/Doctrine/Common/PropertyHelperTrait.php
PropertyHelperTrait.getNestedMetadata
protected function getNestedMetadata(string $resourceClass, array $associations): ClassMetadata { $metadata = $this->getClassMetadata($resourceClass); foreach ($associations as $association) { if ($metadata->hasAssociation($association)) { $associationClass = $metadata->...
php
protected function getNestedMetadata(string $resourceClass, array $associations): ClassMetadata { $metadata = $this->getClassMetadata($resourceClass); foreach ($associations as $association) { if ($metadata->hasAssociation($association)) { $associationClass = $metadata->...
[ "protected", "function", "getNestedMetadata", "(", "string", "$", "resourceClass", ",", "array", "$", "associations", ")", ":", "ClassMetadata", "{", "$", "metadata", "=", "$", "this", "->", "getClassMetadata", "(", "$", "resourceClass", ")", ";", "foreach", "...
Gets nested class metadata for the given resource. @param string[] $associations
[ "Gets", "nested", "class", "metadata", "for", "the", "given", "resource", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/PropertyHelperTrait.php#L146-L159
train
api-platform/core
src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php
ApiPlatformParser.getGroupsForItemAndCollectionOperation
private function getGroupsForItemAndCollectionOperation(ResourceMetadata $resourceMetadata, string $operationName, string $io): array { $operation = $this->getGroupsContext($resourceMetadata, $operationName, true); $operation += $this->getGroupsContext($resourceMetadata, $operationName, false); ...
php
private function getGroupsForItemAndCollectionOperation(ResourceMetadata $resourceMetadata, string $operationName, string $io): array { $operation = $this->getGroupsContext($resourceMetadata, $operationName, true); $operation += $this->getGroupsContext($resourceMetadata, $operationName, false); ...
[ "private", "function", "getGroupsForItemAndCollectionOperation", "(", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "operationName", ",", "string", "$", "io", ")", ":", "array", "{", "$", "operation", "=", "$", "this", "->", "getGroupsContext", ...
Returns groups of item & collection.
[ "Returns", "groups", "of", "item", "&", "collection", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php#L147-L165
train
api-platform/core
src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php
ApiPlatformParser.getPropertyMetadata
private function getPropertyMetadata(ResourceMetadata $resourceMetadata, string $resourceClass, string $io, array $visited, array $options): array { $data = []; foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) { $propertyMetadata = $this-...
php
private function getPropertyMetadata(ResourceMetadata $resourceMetadata, string $resourceClass, string $io, array $visited, array $options): array { $data = []; foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) { $propertyMetadata = $this-...
[ "private", "function", "getPropertyMetadata", "(", "ResourceMetadata", "$", "resourceMetadata", ",", "string", "$", "resourceClass", ",", "string", "$", "io", ",", "array", "$", "visited", ",", "array", "$", "options", ")", ":", "array", "{", "$", "data", "=...
Returns a property metadata. @param string[] $visited @param string[] $options
[ "Returns", "a", "property", "metadata", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/NelmioApiDoc/Parser/ApiPlatformParser.php#L173-L189
train
api-platform/core
src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php
PublishMercureUpdatesListener.onFlush
public function onFlush(OnFlushEventArgs $eventArgs): void { $uow = $eventArgs->getEntityManager()->getUnitOfWork(); foreach ($uow->getScheduledEntityInsertions() as $entity) { $this->storeEntityToPublish($entity, 'createdEntities'); } foreach ($uow->getScheduledEntityU...
php
public function onFlush(OnFlushEventArgs $eventArgs): void { $uow = $eventArgs->getEntityManager()->getUnitOfWork(); foreach ($uow->getScheduledEntityInsertions() as $entity) { $this->storeEntityToPublish($entity, 'createdEntities'); } foreach ($uow->getScheduledEntityU...
[ "public", "function", "onFlush", "(", "OnFlushEventArgs", "$", "eventArgs", ")", ":", "void", "{", "$", "uow", "=", "$", "eventArgs", "->", "getEntityManager", "(", ")", "->", "getUnitOfWork", "(", ")", ";", "foreach", "(", "$", "uow", "->", "getScheduledE...
Collects created, updated and deleted entities.
[ "Collects", "created", "updated", "and", "deleted", "entities", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php#L72-L87
train
api-platform/core
src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php
PublishMercureUpdatesListener.postFlush
public function postFlush(): void { try { foreach ($this->createdEntities as $entity) { $this->publishUpdate($entity, $this->createdEntities[$entity]); } foreach ($this->updatedEntities as $entity) { $this->publishUpdate($entity, $this->up...
php
public function postFlush(): void { try { foreach ($this->createdEntities as $entity) { $this->publishUpdate($entity, $this->createdEntities[$entity]); } foreach ($this->updatedEntities as $entity) { $this->publishUpdate($entity, $this->up...
[ "public", "function", "postFlush", "(", ")", ":", "void", "{", "try", "{", "foreach", "(", "$", "this", "->", "createdEntities", "as", "$", "entity", ")", "{", "$", "this", "->", "publishUpdate", "(", "$", "entity", ",", "$", "this", "->", "createdEnti...
Publishes updates for changes collected on flush, and resets the store.
[ "Publishes", "updates", "for", "changes", "collected", "on", "flush", "and", "resets", "the", "store", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/EventListener/PublishMercureUpdatesListener.php#L92-L109
train
api-platform/core
src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php
RangeFilterTrait.getFilterDescription
protected function getFilterDescription(string $fieldName, string $operator): array { return [ sprintf('%s[%s]', $fieldName, $operator) => [ 'property' => $fieldName, 'type' => 'string', 'required' => false, ], ]; }
php
protected function getFilterDescription(string $fieldName, string $operator): array { return [ sprintf('%s[%s]', $fieldName, $operator) => [ 'property' => $fieldName, 'type' => 'string', 'required' => false, ], ]; }
[ "protected", "function", "getFilterDescription", "(", "string", "$", "fieldName", ",", "string", "$", "operator", ")", ":", "array", "{", "return", "[", "sprintf", "(", "'%s[%s]'", ",", "$", "fieldName", ",", "$", "operator", ")", "=>", "[", "'property'", ...
Gets filter description.
[ "Gets", "filter", "description", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php#L64-L73
train
api-platform/core
src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php
RangeFilterTrait.normalizeBetweenValues
private function normalizeBetweenValues(array $values): ?array { if (2 !== \count($values)) { $this->getLogger()->notice('Invalid filter ignored', [ 'exception' => new InvalidArgumentException(sprintf('Invalid format for "[%s]", expected "<min>..<max>"', self::PARAMETER_BETWEEN))...
php
private function normalizeBetweenValues(array $values): ?array { if (2 !== \count($values)) { $this->getLogger()->notice('Invalid filter ignored', [ 'exception' => new InvalidArgumentException(sprintf('Invalid format for "[%s]", expected "<min>..<max>"', self::PARAMETER_BETWEEN))...
[ "private", "function", "normalizeBetweenValues", "(", "array", "$", "values", ")", ":", "?", "array", "{", "if", "(", "2", "!==", "\\", "count", "(", "$", "values", ")", ")", "{", "$", "this", "->", "getLogger", "(", ")", "->", "notice", "(", "'Inval...
Normalize the values array for between operator.
[ "Normalize", "the", "values", "array", "for", "between", "operator", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php#L99-L118
train
api-platform/core
src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php
RangeFilterTrait.normalizeValue
private function normalizeValue(string $value, string $operator) { if (!is_numeric($value)) { $this->getLogger()->notice('Invalid filter ignored', [ 'exception' => new InvalidArgumentException(sprintf('Invalid value for "[%s]", expected number', $operator)), ]); ...
php
private function normalizeValue(string $value, string $operator) { if (!is_numeric($value)) { $this->getLogger()->notice('Invalid filter ignored', [ 'exception' => new InvalidArgumentException(sprintf('Invalid value for "[%s]", expected number', $operator)), ]); ...
[ "private", "function", "normalizeValue", "(", "string", "$", "value", ",", "string", "$", "operator", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "value", ")", ")", "{", "$", "this", "->", "getLogger", "(", ")", "->", "notice", "(", "'Invalid fil...
Normalize the value. @return int|float|null
[ "Normalize", "the", "value", "." ]
0888bf33429a37d031345bf7c720f23010a50de4
https://github.com/api-platform/core/blob/0888bf33429a37d031345bf7c720f23010a50de4/src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php#L125-L136
train