public function show($id) { $userGroupsRepository = new UserGroups($this->storage); $groupRepository = new GroupRepository($this->storage); $userGroup = $userGroupsRepository->getByGroupForUser($groupRepository->getById($id), $this->currentUser); return ['userGroup' => $userGroup]; }
public function lesson($groupId) { $groupRepository = new GroupRepository($this->storage); $userGroupRepository = new UserGroups($this->storage); $group = $groupRepository->getById($groupId); $userGroup = $userGroupRepository->getByGroupForUser($group, $this->currentUser); return ['group' => $group, 'fiche' => $userGroup->getNextFiche()]; }