ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilECSCommunity Class Reference
+ Collaboration diagram for ilECSCommunity:

Public Member Functions

 __construct (object $json_obj)
 Constructor. More...
 
 getTitle ()
 get title More...
 
 getDescription ()
 getDescription More...
 
 getParticipants ()
 get participants More...
 
 getMids ()
 Get array of mids of all participants. More...
 
 getOwnId ()
 Get own mid of community. More...
 
 getId ()
 get id More...
 

Protected Attributes

object $json_obj
 
string $title = ''
 
string $description = ''
 
int $id = 0
 
array $participants = array()
 
int $position = 0
 

Private Member Functions

 read ()
 Read community entries and participants. More...
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.ilECSCommunity.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCommunity::__construct ( object  $json_obj)

Constructor.

Parameters
objectjson object

Definition at line 39 of file class.ilECSCommunity.php.

References $json_obj, and read().

40  {
41  $this->json_obj = $json_obj;
42  $this->read();
43  }
read()
Read community entries and participants.
+ Here is the call graph for this function:

Member Function Documentation

◆ getDescription()

ilECSCommunity::getDescription ( )

getDescription

Definition at line 56 of file class.ilECSCommunity.php.

References $description.

56  : string
57  {
58  return $this->description;
59  }

◆ getId()

ilECSCommunity::getId ( )

get id

Definition at line 100 of file class.ilECSCommunity.php.

References $id.

Referenced by read().

100  : int
101  {
102  return $this->id;
103  }
+ Here is the caller graph for this function:

◆ getMids()

ilECSCommunity::getMids ( )

Get array of mids of all participants.

Definition at line 74 of file class.ilECSCommunity.php.

References getParticipants().

74  : array
75  {
76  $mids = [];
77  foreach ($this->getParticipants() as $part) {
78  $mids[] = $part->getMID();
79  }
80  return $mids;
81  }
getParticipants()
get participants
+ Here is the call graph for this function:

◆ getOwnId()

ilECSCommunity::getOwnId ( )

Get own mid of community.

Definition at line 86 of file class.ilECSCommunity.php.

References getParticipants().

86  : int
87  {
88  foreach ($this->getParticipants() as $part) {
89  if ($part->isSelf()) {
90  return $part->getMID();
91  }
92  }
93  return 0;
94  }
getParticipants()
get participants
+ Here is the call graph for this function:

◆ getParticipants()

ilECSCommunity::getParticipants ( )

get participants

Returns
ilECSParticipant[]

Definition at line 66 of file class.ilECSCommunity.php.

Referenced by getMids(), and getOwnId().

66  : array
67  {
68  return $this->participants ?: [];
69  }
+ Here is the caller graph for this function:

◆ getTitle()

ilECSCommunity::getTitle ( )

get title

Definition at line 48 of file class.ilECSCommunity.php.

References $title.

48  : string
49  {
50  return $this->title;
51  }

◆ read()

ilECSCommunity::read ( )
private

Read community entries and participants.

Definition at line 109 of file class.ilECSCommunity.php.

References getId().

Referenced by __construct().

109  : void
110  {
111  $this->title = $this->json_obj->community->name;
112  $this->description = $this->json_obj->community->description;
113  $this->id = $this->json_obj->community->cid;
114 
115  foreach ($this->json_obj->participants as $participant) {
116  $this->participants[] = new ilECSParticipant($participant, $this->getId());
117  }
118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $description

string ilECSCommunity::$description = ''
protected

Definition at line 28 of file class.ilECSCommunity.php.

Referenced by getDescription().

◆ $id

int ilECSCommunity::$id = 0
protected

Definition at line 29 of file class.ilECSCommunity.php.

Referenced by getId().

◆ $json_obj

object ilECSCommunity::$json_obj
protected

Definition at line 26 of file class.ilECSCommunity.php.

Referenced by __construct().

◆ $participants

array ilECSCommunity::$participants = array()
protected

Definition at line 31 of file class.ilECSCommunity.php.

◆ $position

int ilECSCommunity::$position = 0
protected

Definition at line 32 of file class.ilECSCommunity.php.

◆ $title

string ilECSCommunity::$title = ''
protected

Definition at line 27 of file class.ilECSCommunity.php.

Referenced by getTitle().


The documentation for this class was generated from the following file: