function SqlContentEntityStorage::buildPropertyQuery

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::buildPropertyQuery()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::buildPropertyQuery()
  3. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::buildPropertyQuery()

Overrides EntityStorageBase::buildPropertyQuery

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 655

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

protected function buildPropertyQuery(QueryInterface $entity_query, array $values) {
    if ($this->dataTable) {
        // @todo We should not be using a condition to specify whether conditions
        //   apply to the default language. See
        //   https://www.drupal.org/node/1866330.
        // Default to the original entity language if not explicitly specified
        // otherwise.
        if (!array_key_exists($this->defaultLangcodeKey, $values)) {
            $values[$this->defaultLangcodeKey] = 1;
        }
        elseif ($values[$this->defaultLangcodeKey] === NULL) {
            unset($values[$this->defaultLangcodeKey]);
        }
    }
    parent::buildPropertyQuery($entity_query, $values);
}

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