You are here

class QueryFactory in Apigee Edge 8

Factory for creating entity query objects for the Apigee Edge backend.

Hierarchy

Expanded class hierarchy of QueryFactory

1 string reference to 'QueryFactory'
apigee_edge.services.yml in ./apigee_edge.services.yml
apigee_edge.services.yml
1 service uses QueryFactory
entity.query.edge in ./apigee_edge.services.yml
Drupal\apigee_edge\Entity\Query\QueryFactory

File

src/Entity/Query/QueryFactory.php, line 31

Namespace

Drupal\apigee_edge\Entity\Query
View source
class QueryFactory implements QueryFactoryInterface {

  /**
   * The namespace of this class, the parent class etc.
   *
   * @var string[]
   */
  protected $namespaces;

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Constructs a QueryFactory object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
    $this->namespaces = QueryBase::getNamespaces($this);
  }

  /**
   * {@inheritdoc}
   */
  public function get(EntityTypeInterface $entity_type, $conjunction) {

    /** @var \Drupal\apigee_edge\Entity\EdgeEntityTypeInterface $entity_type */
    $rc = new \ReflectionClass($entity_type
      ->getQueryClass());
    return $rc
      ->newInstance($entity_type, $conjunction, $this->namespaces, $this->entityTypeManager);
  }

  /**
   * {@inheritdoc}
   */
  public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
    throw new QueryException('Aggregation over Apigee Edge entities is not supported.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueryFactory::$entityTypeManager protected property The entity type manager.
QueryFactory::$namespaces protected property The namespace of this class, the parent class etc.
QueryFactory::get public function Instantiates an entity query for a given entity type. Overrides QueryFactoryInterface::get
QueryFactory::getAggregate public function Instantiates an aggregation query object for a given entity type. Overrides QueryFactoryInterface::getAggregate
QueryFactory::__construct public function Constructs a QueryFactory object.