コード例 #1
0
ファイル: course.php プロジェクト: kevinwojo/hubzero-cms
 /**
  * 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;
 }
コード例 #2
0
 /**
  * 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;
 }