class QueryFactory

Same name in this branch

Factory class creating entity query objects for the SQL backend.

Hierarchy

Expanded class hierarchy of QueryFactory

See also

\Drupal\field_sql_storage\Entity\Query

\Drupal\field_sql_storage\Entity\QueryAggregate

1 string reference to 'QueryFactory'
field_sql_storage.services.yml in drupal/core/modules/field_sql_storage/field_sql_storage.services.yml
drupal/core/modules/field_sql_storage/field_sql_storage.services.yml
1 service uses QueryFactory

File

drupal/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryFactory.php, line 19
Contains \Drupal\field_sql_storage\Entity\QueryFactory.

Namespace

Drupal\field_sql_storage\Entity
View source
class QueryFactory {

  /**
   * Constructs a QueryFactory object.
   *
   * @param \Drupal\Core\Database\Connection $connection
   *   The database connection used by the entity query.
   */
  function __construct(Connection $connection) {
    $this->connection = $connection;
  }

  /**
   * Constructs a entity query for a certain entity type.
   *
   * @param string $entity_type
   *   The entity type.
   * @param 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.
   *
   * @return \Drupal\field_sql_storage\Entity\Query
   *   The factored query.
   */
  function get($entity_type, $conjunction, EntityManager $entity_manager) {
    return new Query($entity_type, $entity_manager, $conjunction, $this->connection);
  }

  /**
   * Constructs a entity aggregation query for a certain entity type.
   *
   * @param string $entity_type
   *   The entity type.
   * @param 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.
   *
   * @return \Drupal\field_sql_storage\Entity\QueryAggregate
   *   The factored aggregation query.
   */
  function getAggregate($entity_type, $conjunction, EntityManager $entity_manager) {
    return new QueryAggregate($entity_type, $entity_manager, $conjunction, $this->connection);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueryFactory::get function Constructs a entity query for a certain entity type.
QueryFactory::getAggregate function Constructs a entity aggregation query for a certain entity type.
QueryFactory::__construct function Constructs a QueryFactory object.