References AbstractFilter
Reference
C
Class

ApiPlatform\Doctrine\Orm\Filter\AbstractFilter

class ApiPlatform\Doctrine\Orm\Filter\AbstractFilter implements , `<a href="/docs/main/references/Doctrine/Common/Filter/PropertyAwareFilterInterface">ApiPlatform\Doctrine\Common\Filter\PropertyAwareFilterInterface</a>`, `<a href="/docs/main/references/Metadata/FilterInterface">ApiPlatform\Metadata\FilterInterface
{
    public __construct(Doctrine\Persistence\ManagerRegistry $managerRegistry, null|Psr\Log\LoggerInterface $logger, null|array $properties, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter)
    public apply(Doctrine\ORM\QueryBuilder $queryBuilder, $queryNameGenerator, string $resourceClass, null|`<a href="/docs/main/references/Metadata/Operation">ApiPlatform\Metadata\Operation $operation, array $context): null
    protected filterProperty(string $property, $value, Doctrine\ORM\QueryBuilder $queryBuilder, $queryNameGenerator, string $resourceClass, null|`<a href="/docs/main/references/Metadata/Operation">ApiPlatform\Metadata\Operation $operation, array $context): null
    protected getManagerRegistry(): Doctrine\Persistence\ManagerRegistry
    protected getProperties(): array
    protected getLogger(): Psr\Log\LoggerInterface
    public setProperties(array<int, string> $properties): null
    protected isPropertyEnabled(string $property, string $resourceClass): bool
    protected denormalizePropertyName(string|int $property): string
    protected normalizePropertyName(string $property): string
    protected splitPropertyParts(string $property, string $resourceClass): array
    protected getClassMetadata(string $resourceClass): Doctrine\Persistence\Mapping\ClassMetadata
    protected addJoinsForNestedProperty(string $property, string $rootAlias, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $joinType): array
    protected isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation): bool
    protected isPropertyNested(string $property, string $resourceClass): bool
    protected isPropertyEmbedded(string $property, string $resourceClass): bool
    protected getDoctrineFieldType(string $property, string $resourceClass): string
    protected getNestedMetadata(string $resourceClass, array<int, string> $associations): Doctrine\Persistence\Mapping\ClassMetadata
    public getDescription(string $resourceClass): array&lt;string, array&gt;
}

Properties

logger

Psr\Log\LoggerInterface $logger

managerRegistry

Doctrine\Persistence\ManagerRegistry $managerRegistry

properties

array $properties

nameConverter

Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter

Methods

__construct

public __construct(Doctrine\Persistence\ManagerRegistry $managerRegistry, null|Psr\Log\LoggerInterface $logger, null|array $properties, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter)

Parameters

managerRegistryDoctrine\Persistence\ManagerRegistry
loggerPsr\Log\LoggerInterface
propertiesarray
nameConverterSymfony\Component\Serializer\NameConverter\NameConverterInterface

apply

Applies the filter.

public apply(Doctrine\ORM\QueryBuilder $queryBuilder, $queryNameGenerator, string $resourceClass, null|`<a href="/docs/main/references/Metadata/Operation">ApiPlatform\Metadata\Operation $operation, array $context): null

Parameters

queryBuilderDoctrine\ORM\QueryBuilder
queryNameGenerator`ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface`
resourceClassstring
operation`ApiPlatform\Metadata\Operation`
contextarray

Returns

null

filterProperty

Passes a property through the filter.

protected filterProperty(string $property, $value, Doctrine\ORM\QueryBuilder $queryBuilder, $queryNameGenerator, string $resourceClass, null|`<a href="/docs/main/references/Metadata/Operation">ApiPlatform\Metadata\Operation $operation, array $context): null

Parameters

propertystring
value
queryBuilderDoctrine\ORM\QueryBuilder
queryNameGenerator`ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface`
resourceClassstring
operation`ApiPlatform\Metadata\Operation`
contextarray

Returns

null

getManagerRegistry

protected getManagerRegistry(): Doctrine\Persistence\ManagerRegistry

Returns

Doctrine\Persistence\ManagerRegistry

getProperties

protected getProperties(): array

Returns

array

getLogger

protected getLogger(): Psr\Log\LoggerInterface

Returns

Psr\Log\LoggerInterface

setProperties

public setProperties(array<int, string> $properties): null

Parameters

propertiesarray<int, string>

Returns

null

isPropertyEnabled

Determines whether the given property is enabled.

protected isPropertyEnabled(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

denormalizePropertyName

protected denormalizePropertyName(string|int $property): string

Parameters

propertystring
int

Returns

string

normalizePropertyName

protected normalizePropertyName(string $property): string

Parameters

propertystring

Returns

string

splitPropertyParts

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)
protected splitPropertyParts(string $property, string $resourceClass): array

Parameters

propertystring
resourceClassstring

Returns

array

getClassMetadata

Gets class metadata for the given resource.

protected getClassMetadata(string $resourceClass): Doctrine\Persistence\Mapping\ClassMetadata

Parameters

resourceClassstring

Returns

Doctrine\Persistence\Mapping\ClassMetadata

addJoinsForNestedProperty

Adds the necessary joins for a nested property.

protected addJoinsForNestedProperty(string $property, string $rootAlias, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $joinType): array

Parameters

propertystring
rootAliasstring
queryBuilderDoctrine\ORM\QueryBuilder
queryNameGenerator`ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface`
resourceClassstring
joinTypestring

Returns

array

isPropertyMapped

Determines whether the given property is mapped.

protected isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation): bool

Parameters

propertystring
resourceClassstring
allowAssociationbool

Returns

bool

isPropertyNested

Determines whether the given property is nested.

protected isPropertyNested(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

isPropertyEmbedded

Determines whether the given property is embedded.

protected isPropertyEmbedded(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

getDoctrineFieldType

Gets the Doctrine Type of a given property/resourceClass.

protected getDoctrineFieldType(string $property, string $resourceClass): string

Parameters

propertystring
resourceClassstring

Returns

string

getNestedMetadata

Gets nested class metadata for the given resource.

protected getNestedMetadata(string $resourceClass, array<int, string> $associations): Doctrine\Persistence\Mapping\ClassMetadata

Parameters

resourceClassstring
associationsarray<int, string>

Returns

Doctrine\Persistence\Mapping\ClassMetadata

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop