PHP Class Sulu\Component\Rest\ListBuilder\Doctrine\DoctrineListBuilder

Inheritance: extends Sulu\Component\Rest\ListBuilder\AbstractListBuilder
ファイルを表示 Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$expressionFields array Array of unique field descriptors from expressions.
$expressions Sulu\Component\Rest\ListBuilder\Expression\Doctrine\AbstractDoctrineExpression[]
$queryBuilder Doctrine\ORM\QueryBuilder
$searchFields Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]
$selectFields Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]

Public Methods

Method Description
__construct ( EntityManager $em, $entityName, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, array $permissions )
count ( )
createAndExpression ( array $expressions )
createBetweenExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, array $values )
createInExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, array $values )
createOrExpression ( array $expressions )
createWhereExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, $value, $comparator )
distinct ( boolean $flag = true ) Eliminates duplicated rows.
execute ( )
setIdField ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $idField ) Set id-field of the "root" entity.

Protected Methods

Method Description
assignGroupBy ( Doctrine\ORM\QueryBuilder $queryBuilder ) Sets group by fields to querybuilder.
assignJoins ( Doctrine\ORM\QueryBuilder $queryBuilder, array $joins = null ) Adds joins to querybuilder.
assignSortFields ( Doctrine\ORM\QueryBuilder $queryBuilder ) Assigns ORDER BY clauses to querybuilder.
createQueryBuilder ( array | null $joins = null ) : Doctrine\ORM\QueryBuilder Creates Querybuilder.
createSubQueryBuilder ( null | string $select = null ) : Doctrine\ORM\QueryBuilder Creates a query-builder for sub-selecting ID's.
findIdsByGivenCriteria ( ) : array Function that finds all IDs of entities that match the search criteria.
getAllFieldNames ( AbstractDoctrineExpression[] $expressions ) : array Returns all fieldnames used in the expressions.
getAllFields ( boolean $onlyReturnFilterFields = false ) : Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[] Returns all FieldDescriptors that were passed to list builder.
getEntityNamesOfFieldDescriptors ( array $filterFields ) : string[] Returns array of field-descriptor aliases.
getJoins ( ) : DoctrineJoinDescriptor[] Returns all the joins required for the query.
getNecessaryJoins ( string[] $necessaryEntityNames ) : Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[] Function returns all necessary joins for filtering result.
getUniqueExpressionFieldDescriptors ( array $expressions ) : array Returns an array of unique expression field descriptors.
hasSelectStatement ( Doctrine\ORM\QueryBuilder $queryBuilder, $statement )

Method Details

__construct() public method

public __construct ( EntityManager $em, $entityName, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, array $permissions )
$em Doctrine\ORM\EntityManager
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$permissions array

assignGroupBy() protected method

Sets group by fields to querybuilder.
protected assignGroupBy ( Doctrine\ORM\QueryBuilder $queryBuilder )
$queryBuilder Doctrine\ORM\QueryBuilder

assignJoins() protected method

Adds joins to querybuilder.
protected assignJoins ( Doctrine\ORM\QueryBuilder $queryBuilder, array $joins = null )
$queryBuilder Doctrine\ORM\QueryBuilder
$joins array

assignSortFields() protected method

Assigns ORDER BY clauses to querybuilder.
protected assignSortFields ( Doctrine\ORM\QueryBuilder $queryBuilder )
$queryBuilder Doctrine\ORM\QueryBuilder

count() public method

public count ( )

createAndExpression() public method

public createAndExpression ( array $expressions )
$expressions array

createBetweenExpression() public method

public createBetweenExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, array $values )
$fieldDescriptor Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface
$values array

createInExpression() public method

public createInExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, array $values )
$fieldDescriptor Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface
$values array

createOrExpression() public method

public createOrExpression ( array $expressions )
$expressions array

createQueryBuilder() protected method

Creates Querybuilder.
protected createQueryBuilder ( array | null $joins = null ) : Doctrine\ORM\QueryBuilder
$joins array | null Define which joins should be made
return Doctrine\ORM\QueryBuilder

createSubQueryBuilder() protected method

Creates a query-builder for sub-selecting ID's.
protected createSubQueryBuilder ( null | string $select = null ) : Doctrine\ORM\QueryBuilder
$select null | string
return Doctrine\ORM\QueryBuilder

createWhereExpression() public method

public createWhereExpression ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $fieldDescriptor, $value, $comparator )
$fieldDescriptor Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface

distinct() public method

Eliminates duplicated rows.
public distinct ( boolean $flag = true )
$flag boolean

execute() public method

public execute ( )

findIdsByGivenCriteria() protected method

Function that finds all IDs of entities that match the search criteria.
protected findIdsByGivenCriteria ( ) : array
return array

getAllFieldNames() protected method

Returns all fieldnames used in the expressions.
protected getAllFieldNames ( AbstractDoctrineExpression[] $expressions ) : array
$expressions Sulu\Component\Rest\ListBuilder\Expression\Doctrine\AbstractDoctrineExpression[]
return array

getAllFields() protected method

Returns all FieldDescriptors that were passed to list builder.
protected getAllFields ( boolean $onlyReturnFilterFields = false ) : Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]
$onlyReturnFilterFields boolean Define if only filtering FieldDescriptors should be returned
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]

getEntityNamesOfFieldDescriptors() protected method

Returns array of field-descriptor aliases.
protected getEntityNamesOfFieldDescriptors ( array $filterFields ) : string[]
$filterFields array
return string[]

getJoins() protected method

Returns all the joins required for the query.
protected getJoins ( ) : DoctrineJoinDescriptor[]
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineJoinDescriptor[]

getNecessaryJoins() protected method

Function returns all necessary joins for filtering result.
protected getNecessaryJoins ( string[] $necessaryEntityNames ) : Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]
$necessaryEntityNames string[]
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]

getUniqueExpressionFieldDescriptors() protected method

Returns an array of unique expression field descriptors.
protected getUniqueExpressionFieldDescriptors ( array $expressions ) : array
$expressions array
return array

hasSelectStatement() protected method

protected hasSelectStatement ( Doctrine\ORM\QueryBuilder $queryBuilder, $statement )
$queryBuilder Doctrine\ORM\QueryBuilder

setIdField() public method

Set id-field of the "root" entity.
public setIdField ( Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface $idField )
$idField Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface

Property Details

$expressionFields protected_oe property

Array of unique field descriptors from expressions.
protected array $expressionFields
return array

$expressions protected_oe property

protected AbstractDoctrineExpression[],Sulu\Component\Rest\ListBuilder\Expression\Doctrine $expressions
return Sulu\Component\Rest\ListBuilder\Expression\Doctrine\AbstractDoctrineExpression[]

$queryBuilder protected_oe property

protected QueryBuilder,Doctrine\ORM $queryBuilder
return Doctrine\ORM\QueryBuilder

$searchFields protected_oe property

protected DoctrineFieldDescriptorInterface[],Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor $searchFields
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]

$selectFields protected_oe property

protected DoctrineFieldDescriptorInterface[],Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor $selectFields
return Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptorInterface[]