Drupal 8  8.0.2
QueryFactory Class Reference
Inheritance diagram for QueryFactory:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager)
 
 get ($entity_type_id, $conjunction= 'AND')
 
 getAggregate ($entity_type_id, $conjunction= 'AND')
 

Protected Attributes

 $entityManager
 

Detailed Description

Factory class Creating entity query objects.

Any implementation of this service must call getQuery()/getAggregateQuery() of the corresponding entity storage.

See Also
::getQuery()
Todo:
https://www.drupal.org/node/2389335 remove entity.query service and replace with using the entity storage's getQuery() method.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager)

Constructs a QueryFactory object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager used by the query.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

get (   $entity_type_id,
  $conjunction = 'AND' 
)

Returns a query object for a given entity type.

Parameters
string$entity_type_idThe entity type ID.
string$conjunction
  • AND: all of the conditions on the query need to match.
  • OR: at least one of the conditions on the query need to match.
Returns
The query object that can query the given entity type.

References Drupal\entityManager().

Referenced by BookUninstallValidator\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

getAggregate (   $entity_type_id,
  $conjunction = 'AND' 
)

Returns an aggregated query object for a given entity type.

Parameters
string$entity_type_idThe entity type ID.
string$conjunction
  • AND: all of the conditions on the query need to match.
  • OR: at least one of the conditions on the query need to match.
Returns
The aggregated query object that can query the given entity type.

References Drupal\entityManager().

Here is the call graph for this function:


The documentation for this class was generated from the following file: