/**
* {@inheritdoc}
*/
public function getGroups(GroupQuery $query = null, GroupsModel $model)
{
if ($query === null) {
$query = new GroupQuery();
}
$model->setHits(count($this->groups));
$offset = ($query->page() - 1) * $query->limit();
return array_slice($this->groups, $offset, $query->limit(), true);
}