protected function Query::result

Executes the query and returns the result.

Return value

int|array Returns the query result as entity IDs.

1 call to Query::result()
QueryAggregate::result in drupal/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryAggregate.php
Overrides \Drupal\field_sql_storage\Entity\Query::result().
1 method overrides Query::result()
QueryAggregate::result in drupal/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/QueryAggregate.php
Overrides \Drupal\field_sql_storage\Entity\Query::result().

File

drupal/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Entity/Query.php, line 268
Definition of Drupal\field_sql_storage\Entity\Query.

Class

Query
The SQL storage entity query class.

Namespace

Drupal\field_sql_storage\Entity

Code

protected function result() {
  if ($this->count) {
    return $this->sqlQuery
      ->countQuery()
      ->execute()
      ->fetchField();
  }

  // Return a keyed array of results. The key is either the revision_id or
  // the entity_id depending on whether the entity type supports revisions.
  // The value is always the entity id.
  return $this->sqlQuery
    ->execute()
    ->fetchAllKeyed();
}