W3cubDocs

/Drupal 8

public function Query::execute

public Query::execute()

Execute the query.

Return value

int|array Returns an integer for count queries or an array of ids. The values of the array are always entity ids. The keys will be revision ids if the entity supports revision and entity ids if not.

Overrides QueryInterface::execute

File

core/lib/Drupal/Core/Entity/Query/Sql/Query.php, line 78

Class

Query
The SQL storage entity query class.

Namespace

Drupal\Core\Entity\Query\Sql

Code

public function execute() {
  return $this
  ->prepare()
    ->compile()
    ->addSort()
    ->finish()
    ->result();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!Sql!Query.php/function/Query::execute/8.1.x