EntityStorageBase::buildPropertyQuery

protected EntityStorageBase::buildPropertyQuery(QueryInterface $entity_query, array $values)

Builds an entity query.

Parameters

\Drupal\Core\Entity\Query\QueryInterface $entity_query: EntityQuery instance.

array $values: An associative array of properties of the entity, where the keys are the property names and the values are the values those properties must have.

File

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

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

1
2
3
4
5
6
protected function buildPropertyQuery(QueryInterface $entity_query, array $values) {
  foreach ($values as $name => $value) {
    // Cast scalars to array so we can consistently use an IN condition.
    $entity_query->condition($name, (array) $value, 'IN');
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.