You are here

protected function WebformSubmissionStorage::buildPropertyQuery in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionStorage.php \Drupal\webform\WebformSubmissionStorage::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 SqlContentEntityStorage::buildPropertyQuery

File

src/WebformSubmissionStorage.php, line 235

Class

WebformSubmissionStorage
Defines the webform submission storage.

Namespace

Drupal\webform

Code

protected function buildPropertyQuery(QueryInterface $entity_query, array $values) {

  // Add account query when ever filtered by uid.
  if (isset($values['uid'])) {
    $uids = (array) $values['uid'];
    $accounts = User::loadMultiple($uids);
    $or_condition_group = $entity_query
      ->orConditionGroup();
    foreach ($accounts as $account) {
      $this
        ->_addQueryConditions($or_condition_group, NULL, NULL, $account);
    }
    $entity_query
      ->condition($or_condition_group);
    unset($values['uid']);
  }
  parent::buildPropertyQuery($entity_query, $values);
}