class QueryFactory

Factory class Creating entity query objects.

Hierarchy

Expanded class hierarchy of QueryFactory

3 files declare their use of QueryFactory
EfqTest.php in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/EfqTest.php
Definition of Drupal\taxonomy\Tests\EfqTest.
field.module in drupal/core/modules/field/field.module
Attach custom data fields to Drupal entities.
options.module in drupal/core/modules/field/modules/options/options.module
Defines selection, check box and radio button widgets for text and numeric fields.

File

drupal/core/lib/Drupal/Core/Entity/Query/QueryFactory.php, line 15
Definition of Drupal\Core\Entity\Query\QueryFactory.

Namespace

Drupal\Core\Entity\Query
View source
class QueryFactory {

  /**
   * var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  protected $container;

  /**
   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
   */
  function __construct(ContainerInterface $container) {
    $this->container = $container;
  }

  /**
   * @param string $entity_type
   * @param string $conjunction
   * @return QueryInterface
   */
  public function get($entity_type, $conjunction = 'AND') {
    $service_name = entity_get_controller($entity_type)
      ->getQueryServicename();
    return $this->container
      ->get($service_name)
      ->get($entity_type, $conjunction);
  }

}

Members