/** * Retrieve a specific manager record by user ID * * @return boolean */ public function manager($user_id = null) { if (!isset($this->_manager) || $user_id !== null && (int) $this->_manager->get('user_id') != $user_id) { $this->_manager = null; if (isset($this->_managers) && isset($this->_managers[$user_id])) { $this->_manager = $this->_managers[$user_id]; } if (!$this->_manager) { $this->_manager = \Components\Courses\Models\Manager::getInstance($user_id, $this->get('course_id'), 0, 0); } } return $this->_manager; }
/** * Check if the current user is enrolled * * @param integer $user_ID * @return boolean */ public function manager($user_id = null) { if (!isset($this->_manager) || $user_id !== null && (int) $this->_manager->get('user_id') != $user_id) { $this->_manager = null; if (isset($this->_managers) && isset($this->_managers[$user_id])) { $this->_manager = $this->_managers[$user_id]; } if (!$this->_manager) { $this->_manager = Manager::getInstance($user_id, $this->get('course_id'), $this->get('offering_id'), $this->get('section_id')); } } return $this->_manager; }