protected function DatabaseStorageControllerNG::buildPropertyQuery

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 DatabaseStorageController::buildPropertyQuery

1 call to DatabaseStorageControllerNG::buildPropertyQuery()
1 method overrides DatabaseStorageControllerNG::buildPropertyQuery()

File

drupal/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php, line 138
Contains \Drupal\Core\Entity\DatabaseStorageControllerNG.

Class

DatabaseStorageControllerNG
Implements Field API specific enhancements to the DatabaseStorageController class.

Namespace

Drupal\Core\Entity

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 http://drupal.org/node/1866330.
    // Default to the original entity language if not explicitly specified
    // otherwise.
    if (!array_key_exists('default_langcode', $values)) {
      $values['default_langcode'] = 1;
    }
    elseif ($values['default_langcode'] === NULL) {
      unset($values['default_langcode']);
    }
  }
  parent::buildPropertyQuery($entity_query, $values);
}