function EntityStorageBase::loadByProperties

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::loadByProperties()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::loadByProperties()
  3. 11.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::loadByProperties()

Overrides EntityStorageInterface::loadByProperties

3 methods override EntityStorageBase::loadByProperties()
ContentEntityNullStorage::loadByProperties in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Load entities by their property values without any access checks.
FieldConfigStorage::loadByProperties in core/modules/field/src/FieldConfigStorage.php
Load entities by their property values without any access checks.
FieldStorageConfigStorage::loadByProperties in core/modules/field/src/FieldStorageConfigStorage.php
Load entities by their property values without any access checks.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 602

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function loadByProperties(array $values = []) {
    // Build a query to fetch the entity IDs.
    $entity_query = $this->getQuery();
    $entity_query->accessCheck(FALSE);
    $this->buildPropertyQuery($entity_query, $values);
    $result = $entity_query->execute();
    return $result ? $this->loadMultiple($result) : [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.