Easy peasy:
$quizzes = QuizQuery::create()->
filterByUser($user)->
orderByCreatedAt(\Criteria::DESC)->
limit(5)->
find()
;
This assumes you have a created_at
column in your quiz table. You can then add this to your User
model if you wish:
public function getLastQuizzes($limit = 5)
{
return QuizQuery::create()->
filterByUser($this)->
orderByCreatedAt(\Criteria::DESC)->
limit($limit)->
find()
;
}