public function indexAction() { $projectsModel = new Projects(); $user = $this->session->getCurrentUser(); if ($user->roles_id == 1) { $this->view->projects = $projectsModel->getProjectsDatasAll(); } else { $this->view->projects = $projectsModel->getProjectsDatasByUsersId($user->id); } $this->view->user = $user; }