getUser($request), $course)) { throw new AuthorizationFailedException(); } if (!$wiki = \WikiPage::findBySQL('`range_id` = ? ORDER BY name ASC ', [$course->id])) { throw new RecordNotFoundException(); } $wiki = \SimpleORMapCollection::createFromArray($wiki); list($offset, $limit) = $this->getOffsetAndLimit(); return $this->getPaginatedContentResponse( $wiki->limit($offset, $limit), count($wiki) ); } }