You are here

public function EntityAPIController::query in Entity API 7

Builds and executes the query for loading.

Return value

Traversable The results in a Traversable object.

1 call to EntityAPIController::query()
EntityAPIController::load in includes/entity.controller.inc
Overridden.

File

includes/entity.controller.inc, line 190
Provides a controller building upon the core controller but providing more features like full CRUD functionality.

Class

EntityAPIController
A controller implementing EntityAPIControllerInterface for the database.

Code

public function query($ids, $conditions, $revision_id = FALSE) {

  // Build the query.
  $query = $this
    ->buildQuery($ids, $conditions, $revision_id);
  $result = $query
    ->execute();
  if (!empty($this->entityInfo['entity class'])) {
    $result
      ->setFetchMode(PDO::FETCH_CLASS, $this->entityInfo['entity class'], array(
      array(),
      $this->entityType,
    ));
  }
  return $result;
}