Skip to content

Commit

Permalink
Merge pull request #21 from bookboon/feature/get-all-exams
Browse files Browse the repository at this point in the history
Get all exams
  • Loading branch information
lkm authored Nov 9, 2018
2 parents 65ba475 + 57ffdc4 commit 13a1e06
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Entity/Exam.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ public static function getByBookId(Bookboon $bookboon, $bookId)
return $bResponse;
}

/**
* Get many exams
*
* @param Bookboon $bookboon
* @return BookboonResponse
*/
public static function getAll(Bookboon $bookboon)
{
$bResponse = $bookboon->rawRequest("/exams");

$bResponse->setEntityStore(
new EntityStore(
[
static::getEntitiesFromArray($bResponse->getReturnArray())
]
)
);

return $bResponse;
}

public static function start(Bookboon $bookboon, $examId)
{
return $bookboon->rawRequest("/exams/$examId", [], Client::HTTP_POST)->getReturnArray();
Expand Down

0 comments on commit 13a1e06

Please sign in to comment.