PHP Class PartKeepr\DoctrineReflectionBundle\Filter\AdvancedSearchFilter

Allows filtering by different operators and nested associations. Expects a query parameter "filter" which includes JSON in the following format: [{ property: 'comments.authors.name', operator: 'LIKE', value: '%heiner%' }] You can also specify multiple filters with different operators and values.
Inheritance: extends Dunglas\ApiBundle\Doctrine\Orm\Filter\AbstractFilter
Datei anzeigen Open project: partkeepr/PartKeepr

Public Methods

Method Description
__construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Dunglas\ApiBundle\Api\IriConverterInterface $iriConverter, Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, Symfony\Component\HttpFoundation\RequestStack $requestStack, array $properties = null )
apply ( Dunglas\ApiBundle\Api\ResourceInterface $resource, Doctrine\ORM\QueryBuilder $queryBuilder )
extractConfiguration ( $filterData, $sorterData )
filter ( Doctrine\ORM\QueryBuilder $queryBuilder, $filters, $sorters )
getDescription ( Dunglas\ApiBundle\Api\ResourceInterface $resource )

Private Methods

Method Description
addJoins ( Doctrine\ORM\QueryBuilder $queryBuilder, PartKeepr\DoctrineReflectionBundle\Filter\AssociationPropertyInterface $filter ) Adds all required joins to the queryBuilder.
applyOrderByExpression ( Doctrine\ORM\QueryBuilder $queryBuilder, Sorter $sorter ) : Doctrine\ORM\Query\Expr\Comparison | Doctrine\ORM\Query\Expr\Func Returns the expression for a specific sort order.
extractJSONFilters ( $data ) : Filter Extracts the filters from the JSON object.
extractJSONSorters ( $data ) : Sorter Extracts the sorters from the JSON object.
getAlias ( string $property ) : string Returns an alias for the given association property.
getFilterExpression ( Doctrine\ORM\QueryBuilder $queryBuilder, Filter $filter ) : Doctrine\ORM\Query\Expr\Comparison | Doctrine\ORM\Query\Expr\Func Returns the expression for a specific filter.
getFilterValueFromUrl ( string $value ) : string Gets the ID from an URI or a raw ID.

Method Details

__construct() public method

public __construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Dunglas\ApiBundle\Api\IriConverterInterface $iriConverter, Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, Symfony\Component\HttpFoundation\RequestStack $requestStack, array $properties = null )
$managerRegistry Doctrine\Common\Persistence\ManagerRegistry
$iriConverter Dunglas\ApiBundle\Api\IriConverterInterface
$propertyAccessor Symfony\Component\PropertyAccess\PropertyAccessorInterface
$requestStack Symfony\Component\HttpFoundation\RequestStack
$properties array Null to allow filtering on all properties with the exact strategy or a map of property name with strategy.

apply() public method

public apply ( Dunglas\ApiBundle\Api\ResourceInterface $resource, Doctrine\ORM\QueryBuilder $queryBuilder )
$resource Dunglas\ApiBundle\Api\ResourceInterface
$queryBuilder Doctrine\ORM\QueryBuilder

extractConfiguration() public method

public extractConfiguration ( $filterData, $sorterData )

filter() public method

public filter ( Doctrine\ORM\QueryBuilder $queryBuilder, $filters, $sorters )
$queryBuilder Doctrine\ORM\QueryBuilder

getDescription() public method

public getDescription ( Dunglas\ApiBundle\Api\ResourceInterface $resource )
$resource Dunglas\ApiBundle\Api\ResourceInterface