You are here

public static function Drupal::entityQuery in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal.php \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.

13 calls to Drupal::entityQuery()
BookNavigationBlock::build in core/modules/book/src/Plugin/Block/BookNavigationBlock.php
Builds and returns the renderable array for this block plugin.
comment_entity_predelete in core/modules/comment/comment.module
Implements hook_entity_predelete().
comment_field_config_delete in core/modules/comment/comment.module
Implements hook_ENTITY_TYPE_delete() for 'field_config'.
comment_user_predelete in core/modules/comment/comment.module
Implements hook_ENTITY_TYPE_predelete() for user entities.
DrupalTest::testEntityQuery in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the entityQuery() method.

... See full list

File

core/lib/Drupal.php, line 435
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

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