/**
  * Log a change of the instructors of the course.
  * 
  * @since 0.1
  * 
  * @param string $action
  * @param array $instructors
  * @param string $message
  */
 protected function logInstructorChange($action, array $instructors, $message)
 {
     $names = array();
     foreach ($instructors as $userId) {
         $names[] = EPInstructor::newFromId($userId)->getName();
     }
     $info = array('type' => 'instructor', 'subtype' => $action, 'title' => $this->getTitle(), 'parameters' => array('4::instructorcount' => count($names), '5::instructors' => $GLOBALS['wgLang']->listToText($names)));
     if ($message !== '') {
         $info['comment'] = $message;
     }
     EPUtils::log($info);
 }
Beispiel #2
0
 /**
  * Returns the instructors as a list of EPInstructor objects.
  *
  * @since 0.1
  *
  * @return array of EPInstructor
  */
 public function getInstructors()
 {
     if ($this->instructors === false) {
         $this->instructors = array();
         foreach ($this->getField('instructors') as $userId) {
             $this->instructors[] = EPInstructor::newFromUserId($userId);
         }
     }
     return $this->instructors;
 }