public EntityStorageBase::loadByProperties(array $values = array())
Load entities by their property values.
array $values: An associative array where the keys are the property names and the values are the values those properties must have.
\Drupal\Core\Entity\EntityInterface[] An array of entity objects indexed by their ids.
Overrides EntityStorageInterface::loadByProperties
public function loadByProperties(array $values = array()) { // Build a query to fetch the entity IDs. $entity_query = $this->getQuery(); $this->buildPropertyQuery($entity_query, $values); $result = $entity_query->execute(); return $result ? $this->loadMultiple($result) : array(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityStorageBase.php/function/EntityStorageBase::loadByProperties/8.1.x