You are here

public function CourseObjectFulfillmentController::query in Course 7

Same name and namespace in other branches
  1. 7.2 includes/CourseObjectFulfillmentController.inc \CourseObjectFulfillmentController::query()

Overrides EntityAPIController::query().

Overrides EntityAPIController::query

File

includes/CourseObjectFulfillmentController.inc, line 42

Class

CourseObjectFulfillmentController

Code

public function query($ids, $conditions, $revision_id = FALSE) {
  $query = $this
    ->buildQuery($ids, $conditions, $revision_id);
  $query
    ->join('course_outline', 'co', 'base.coid = co.coid');
  $query
    ->fields('co', array(
    'module',
    'object_type',
  ));
  $result = $query
    ->execute();
  $result
    ->setFetchMode(PDO::FETCH_ASSOC);

  // Build the resulting objects ourselves, since the standard PDO ways of
  // doing that are completely useless.
  $objects = array();
  foreach ($result as $row) {
    $row['is_new'] = FALSE;
    $objects[] = $this
      ->create($row);
  }
  return $objects;
}