Beispiel #1
0
 /**
  * @param PagingSearch $ps
  *
  * @return Course[]
  */
 public function getAll(PagingSearch $ps = null)
 {
     $response = $this->service->get("/users/{$this->user_id}/courses", $ps);
     $xml = new \SimpleXMLElement($response);
     $courses = array();
     $course_nodes = $xml->children();
     foreach ($course_nodes as $course_node) {
         $id = (string) $course_node->Id;
         $code = (string) $course_node->Code;
         $name = (string) $course_node->Name;
         $active = filter_var((string) $course_node->Active, FILTER_VALIDATE_BOOLEAN);
         $course = new Course($id, $code, $name, $active);
         $courses[] = $course;
     }
     return $courses;
 }
Beispiel #2
0
 /**
  * @param PagingSearch $ps
  *
  * @return UserBasic[]
  */
 public function getAll(PagingSearch $ps = null)
 {
     $response = $this->service->get("/teams/{$this->team_id}/users", $ps);
     $xml = new \SimpleXMLElement($response);
     $users = array();
     $user_nodes = $xml->children();
     foreach ($user_nodes as $user_node) {
         $id = (string) $user_node->Id;
         $user_name = (string) $user_node->UserName;
         $first_name = (string) $user_node->FirstName;
         $last_name = (string) $user_node->LastName;
         $user = new UserBasic($this->service, $id, $user_name, $first_name, $last_name);
         $users[] = $user;
     }
     return $users;
 }
Beispiel #3
0
 /**
  * @return void
  */
 public function update()
 {
     $this->service->getTeams()->update($this);
 }
Beispiel #4
0
 /**
  * @param User $user
  */
 public function update(User $user)
 {
     $xml = $user->toXml();
     $this->service->put("/users/{$user->getUserId()}", $xml);
 }
Beispiel #5
0
 /**
  * @param Team $team
  */
 public function update(Team $team)
 {
     $xml = $team->toXml();
     $this->service->put("/teams/{$team->getId()}", $xml);
 }