public static function Drupal::entityQuery

Returns the entity query object for this entity type.

Parameters

string $entity_type: The entity type, e.g. node, for which the query object should be returned.

string $conjunction: AND if all conditions in the query need to apply, OR if any of them is enough. Optional, defaults to AND.

Return value

\Drupal\Core\Entity\Query\QueryInterface The query object that can query the given entity type.

12 calls to Drupal::entityQuery()
DatabaseStorageController::loadByProperties in drupal/core/lib/Drupal/Core/Entity/DatabaseStorageController.php
Implements \Drupal\Core\Entity\EntityStorageControllerInterface::loadByProperties().
DrupalUnitTestBaseTest::testEnableModulesInstallContainer in drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
Tests installing modules via enableModules() with DepedencyInjection services.
EntityQueryTest::testMetaData in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
Test adding a tag and metadata to the Entity query object.
EntityReferenceAutoCreateTest::testAutoCreate in drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutoCreateTest.php
Assert creation on a new entity.
EntityTranslationTest::assertMultilingualProperties in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
Executes the multilingual property tests for the given entity type.

... See full list

File

drupal/core/lib/Drupal.php, line 301
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function entityQuery($entity_type, $conjunction = 'AND') {
  return static::$container
    ->get('entity.query')
    ->get($entity_type, $conjunction);
}