ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilECSCommunity.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 {
34  protected $json_obj = null;
35  protected $title = '';
36  protected $description = '';
37  protected $id = 0;
38 
39  protected $participants = array();
40  protected $position = 0;
41 
49  public function __construct($json_obj)
50  {
51  $this->json_obj = $json_obj;
52  $this->read();
53  }
54 
61  public function getTitle()
62  {
63  return $this->title;
64  }
65 
72  public function getDescription()
73  {
74  return $this->description;
75  }
76 
83  public function getParticipants()
84  {
85  return $this->participants ? $this->participants : array();
86  }
87 
94  public function getId()
95  {
96  return $this->id;
97  }
98 
99 
106  private function read()
107  {
108  $this->title = $this->json_obj->community->name;
109  $this->description = $this->json_obj->community->description;
110  $this->id = $this->json_obj->community->id;
111 
112  foreach($this->json_obj->participants as $participant)
113  {
114  include_once('./Services/WebServices/ECS/classes/class.ilECSParticipant.php');
115  $this->participants[] = new ilECSParticipant($participant,$this->getId());
116  }
117  }
118 }
119 
120 
121 ?>