You are here

protected function ContentEntityStorage::buildPropertyQuery in MongoDB 8

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.

Overrides EntityStorageBase::buildPropertyQuery

File

src/Entity/ContentEntityStorage.php, line 416
Contains Drupal\mongodb\Entity\ContentEntityStorage.

Class

ContentEntityStorage

Namespace

Drupal\mongodb\Entity

Code

protected function buildPropertyQuery(QueryInterface $entity_query, array $values) {
  $default_langcode_key = $this->entityType
    ->getKey('default_langcode');
  if ($default_langcode_key) {
    if (!array_key_exists($default_langcode_key, $values)) {
      if ($this->entityType
        ->isTranslatable()) {
        $values[$default_langcode_key] = 1;
      }
    }
    elseif ($values[$default_langcode_key] === NULL) {
      unset($values[$default_langcode_key]);
    }
  }
  parent::buildPropertyQuery($entity_query, $values);
}