Esempio n. 1
0
 /**
  * Retrieves all members of a status
  *
  * @param String|Array $status  the status to filter with
  *
  * @return Array an array of all those members.
  */
 function getMembersWithStatus($status)
 {
     return CourseMember::findByCourseAndStatus($this->id, $status);
 }
Esempio n. 2
0
 /**
  * Returns the teacher for a given cours
  *
  * @param String $course_id Id of the course
  * @return array of user infos [user_id, username, Nachname, fullname]
  */
 private function getTeacher($course_id)
 {
     $teachers = CourseMember::findByCourseAndStatus($course_id, 'dozent');
     $collection = SimpleCollection::createFromArray($teachers);
     return $collection->map(function (CourseMember $teacher) {
         return array('user_id' => $teacher->user_id, 'username' => $teacher->username, 'Nachname' => $teacher->nachname, 'fullname' => $teacher->getUserFullname('no_title_rev'));
     });
 }