public function getType() { $type = null; if (is_int($this->type)) { $type = TypeDAL::findById($this->type); } else { if (is_a($this->type, "Type")) { $type = $this->type; } } return $type; }
<?php require_once 'model/DAL/ModuleDAL.php'; require_once 'model/DAL/TypeDAL.php'; // Test the user's level of access $role = $_SESSION['user']->getRole()->getName(); if ($role === 'Professor') { $_SESSION['data']['modules'] = ModuleDAL::findAll(); $_SESSION['data']['types'] = TypeDAL::findAll(); require_once 'view/menu/menu_administration.phtml'; require_once 'view/administration/administration_report.phtml'; } else { header('Location: ../home'); }