protected function onLoad() { if (!isset($_SESSION['userid'])) { $this->redirect('users', 'login'); } if ($this->currentPlayer == null) { $this->currentPlayer = PlayerRepository::create()->getOne($_SESSION['userid']); } if ($this->currentUniversity == null) { $this->currentUniversity = UniversityRepository::create()->getOne($_SESSION['university_id']); } $this->view->playerName = $this->currentPlayer->getUsername(); $this->view->university = $this->currentUniversity; $this->view->partial('authHeader'); }
public function save() { return UniversityRepository::create()->save($this); }