protected static function _getRequestedStudent() { if (!empty($_GET['student']) && $GLOBALS['Session']->hasAccountLevel('Staff')) { if (!($Student = Student::getByHandle($_GET['student']))) { return static::throwNotFoundError('Student not found'); } } else { $Student = $GLOBALS['Session']->Person; } if (!$Student->isA(Student::class)) { return static::throwInvalidRequestError('Requested user is not a student'); } return $Student; }