function entity_query

Returns the entity query object for this entity type.

Parameters

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

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

5 calls to entity_query()
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.
EntityTranslationTest::testMultilingualProperties in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
Tests multilingual properties.
translation_entity_translatable_batch in drupal/core/modules/translation_entity/translation_entity.admin.inc
Batch callback: Converts field data to or from LANGUAGE_NOT_SPECIFIED.
1 string reference to 'entity_query'
Query::execute in drupal/core/modules/field/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Query.php
Implements Drupal\Core\Entity\Query\QueryInterface::execute().

File

drupal/core/includes/entity.inc, line 576
Entity API for handling entities like nodes or users.

Code

function entity_query($entity_type, $conjunction = 'AND') {
  return drupal_container()
    ->get('entity.query')
    ->get($entity_type, $conjunction);
}