PHP Класс ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractFilter

Abstract class with helpers for easing the implementation of a filter.
Автор: Kévin Dunglas ([email protected])
Автор: Théo FIDRY ([email protected])
Наследование: implements ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\FilterInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$logger
$managerRegistry
$properties
$requestStack

Открытые методы

Метод Описание
__construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Symfony\Component\HttpFoundation\RequestStack $requestStack, Psr\Log\LoggerInterface $logger = null, array $properties = null )
apply ( Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null )

Защищенные методы

Метод Описание
addJoinOnce ( Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association ) : string Adds a join to the queryBuilder if none exists.
addJoinsForNestedProperty ( string $property, string $rootAlias, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator ) : array Adds the necessary joins for a nested property.
extractProperties ( Request $request ) : array Extracts properties to filter from the request.
filterProperty ( string $property, mixed $value, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null ) Passes a property through the filter.
getClassMetadata ( string $resourceClass ) : Doctrine\Common\Persistence\Mapping\ClassMetadata Gets class metadata for the given resource.
getNestedMetadata ( string $resourceClass, array $associations ) : Doctrine\Common\Persistence\Mapping\ClassMetadata Gets nested class metadata for the given resource.
isPropertyEnabled ( string $property ) : boolean Determines whether the given property is enabled.
isPropertyMapped ( string $property, string $resourceClass, boolean $allowAssociation = false ) : boolean Determines whether the given property is mapped.
isPropertyNested ( string $property ) : boolean Determines whether the given property is nested.
splitPropertyParts ( string $property ) : array Splits the given property into parts.

Приватные методы

Метод Описание
getExistingJoin ( Doctrine\ORM\QueryBuilder $queryBuilder, string $alias, string $association ) : Doctrine\ORM\Query\Expr\Join | null Get the existing join from queryBuilder DQL parts.

Описание методов

__construct() публичный метод

public __construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Symfony\Component\HttpFoundation\RequestStack $requestStack, Psr\Log\LoggerInterface $logger = null, array $properties = null )
$managerRegistry Doctrine\Common\Persistence\ManagerRegistry
$requestStack Symfony\Component\HttpFoundation\RequestStack
$logger Psr\Log\LoggerInterface
$properties array

addJoinOnce() защищенный метод

Adds a join to the queryBuilder if none exists.
protected addJoinOnce ( Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association ) : string
$queryBuilder Doctrine\ORM\QueryBuilder
$queryNameGenerator ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
$alias string
$association string the association field
Результат string the new association alias

addJoinsForNestedProperty() защищенный метод

Adds the necessary joins for a nested property.
protected addJoinsForNestedProperty ( string $property, string $rootAlias, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator ) : array
$property string
$rootAlias string
$queryBuilder Doctrine\ORM\QueryBuilder
$queryNameGenerator ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
Результат 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

apply() публичный метод

public apply ( Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null )
$queryBuilder Doctrine\ORM\QueryBuilder
$queryNameGenerator ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
$resourceClass string
$operationName string

extractProperties() защищенный метод

Extracts properties to filter from the request.
protected extractProperties ( Request $request ) : array
$request Symfony\Component\HttpFoundation\Request
Результат array

filterProperty() абстрактный защищенный метод

Passes a property through the filter.
abstract protected filterProperty ( string $property, mixed $value, Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null )
$property string
$value mixed
$queryBuilder Doctrine\ORM\QueryBuilder
$queryNameGenerator ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
$resourceClass string
$operationName string

getClassMetadata() защищенный метод

Gets class metadata for the given resource.
protected getClassMetadata ( string $resourceClass ) : Doctrine\Common\Persistence\Mapping\ClassMetadata
$resourceClass string
Результат Doctrine\Common\Persistence\Mapping\ClassMetadata

getNestedMetadata() защищенный метод

Gets nested class metadata for the given resource.
protected getNestedMetadata ( string $resourceClass, array $associations ) : Doctrine\Common\Persistence\Mapping\ClassMetadata
$resourceClass string
$associations array
Результат Doctrine\Common\Persistence\Mapping\ClassMetadata

isPropertyEnabled() защищенный метод

Determines whether the given property is enabled.
protected isPropertyEnabled ( string $property ) : boolean
$property string
Результат boolean

isPropertyMapped() защищенный метод

Determines whether the given property is mapped.
protected isPropertyMapped ( string $property, string $resourceClass, boolean $allowAssociation = false ) : boolean
$property string
$resourceClass string
$allowAssociation boolean
Результат boolean

isPropertyNested() защищенный метод

Determines whether the given property is nested.
protected isPropertyNested ( string $property ) : boolean
$property string
Результат boolean

splitPropertyParts() защищенный метод

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 ) : array
$property string
Результат array

Описание свойств

$logger защищенное свойство

protected $logger

$managerRegistry защищенное свойство

protected $managerRegistry

$properties защищенное свойство

protected $properties

$requestStack защищенное свойство

protected $requestStack