PHP Class ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\PaginationExtension

Author: Kévin Dunglas ([email protected])
Author: Samuel ROZE ([email protected])
Inheritance: implements ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryResultCollectionExtensionInterface
Exibir arquivo Open project: api-platform/core Class Usage Examples

Public Methods

Method Description
__construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Symfony\Component\HttpFoundation\RequestStack $requestStack, ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface $resourceMetadataFactory, boolean $enabled = true, boolean $clientEnabled = false, boolean $clientItemsPerPage = false, integer $itemsPerPage = 30, string $pageParameterName = 'page', string $enabledParameterName = 'pagination', string $itemsPerPageParameterName = 'itemsPerPage', integer $maximumItemPerPage = null )
applyToCollection ( Doctrine\ORM\QueryBuilder $queryBuilder, ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, string $operationName = null )
getResult ( Doctrine\ORM\QueryBuilder $queryBuilder )
supportsResult ( string $resourceClass, string $operationName = null ) : boolean

Private Methods

Method Description
isPaginationEnabled ( Request $request, ResourceMetadata $resourceMetadata, string $operationName = null ) : boolean
useFetchJoinCollection ( Doctrine\ORM\QueryBuilder $queryBuilder ) : boolean Determines whether the Paginator should fetch join collections, if the root entity uses composite identifiers it should not.
useOutputWalkers ( Doctrine\ORM\QueryBuilder $queryBuilder ) : boolean Determines whether output walkers should be used.

Method Details

__construct() public method

public __construct ( Doctrine\Common\Persistence\ManagerRegistry $managerRegistry, Symfony\Component\HttpFoundation\RequestStack $requestStack, ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface $resourceMetadataFactory, boolean $enabled = true, boolean $clientEnabled = false, boolean $clientItemsPerPage = false, integer $itemsPerPage = 30, string $pageParameterName = 'page', string $enabledParameterName = 'pagination', string $itemsPerPageParameterName = 'itemsPerPage', integer $maximumItemPerPage = null )
$managerRegistry Doctrine\Common\Persistence\ManagerRegistry
$requestStack Symfony\Component\HttpFoundation\RequestStack
$resourceMetadataFactory ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface
$enabled boolean
$clientEnabled boolean
$clientItemsPerPage boolean
$itemsPerPage integer
$pageParameterName string
$enabledParameterName string
$itemsPerPageParameterName string
$maximumItemPerPage integer

applyToCollection() public method

public applyToCollection ( 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

getResult() public method

public getResult ( Doctrine\ORM\QueryBuilder $queryBuilder )
$queryBuilder Doctrine\ORM\QueryBuilder

supportsResult() public method

public supportsResult ( string $resourceClass, string $operationName = null ) : boolean
$resourceClass string
$operationName string
return boolean