Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

QueryFactoryInterface.php

Namespace

Drupal\Core\Entity\Query

File

core/lib/Drupal/Core/Entity/Query/QueryFactoryInterface.php

View source
<?php

namespace Drupal\Core\Entity\Query;

use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Defines an interface for QueryFactory classes.
 */
interface QueryFactoryInterface {
    
    /**
     * Instantiates an entity query for a given entity type.
     *
     * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
     *   The entity type definition.
     * @param string $conjunction
     *   The operator to use to combine conditions: 'AND' or 'OR'.
     *
     * @return \Drupal\Core\Entity\Query\QueryInterface
     *   An entity query for a specific configuration entity type.
     */
    public function get(EntityTypeInterface $entity_type, $conjunction);
    
    /**
     * Instantiates an aggregation query object for a given entity type.
     *
     * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
     *   The entity type definition.
     * @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\Core\Entity\Query\QueryAggregateInterface
     *   The query object that can query the given entity type.
     *
     * @throws \Drupal\Core\Entity\Query\QueryException
     */
    public function getAggregate(EntityTypeInterface $entity_type, $conjunction);

}

Interfaces

Title Deprecated Summary
QueryFactoryInterface Defines an interface for QueryFactory classes.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal