ILIAS  release_8 Revision v8.23
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 23 of file class.ilECSCommunity.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCommunity::__construct ( object  $json_obj)

Constructor.

Parameters
objectjson object

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

References $json_obj, and read().

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

Member Function Documentation

◆ getDescription()

ilECSCommunity::getDescription ( )

getDescription

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

References $description.

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

◆ getId()

ilECSCommunity::getId ( )

get id

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

References $id.

Referenced by read().

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

◆ getMids()

ilECSCommunity::getMids ( )

Get array of mids of all participants.

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

References getParticipants().

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

◆ getOwnId()

ilECSCommunity::getOwnId ( )

Get own mid of community.

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

References getParticipants().

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

◆ getParticipants()

ilECSCommunity::getParticipants ( )

get participants

Returns
ilECSParticipant[]

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

Referenced by getMids(), and getOwnId().

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

◆ getTitle()

ilECSCommunity::getTitle ( )

get title

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

References $title.

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

◆ read()

ilECSCommunity::read ( )
private

Read community entries and participants.

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

References getId().

Referenced by __construct().

108  : void
109  {
110  $this->title = $this->json_obj->community->name;
111  $this->description = $this->json_obj->community->description;
112  $this->id = $this->json_obj->community->cid;
113 
114  foreach ($this->json_obj->participants as $participant) {
115  $this->participants[] = new ilECSParticipant($participant, $this->getId());
116  }
117  }
+ 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 27 of file class.ilECSCommunity.php.

Referenced by getDescription().

◆ $id

int ilECSCommunity::$id = 0
protected

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

Referenced by getId().

◆ $json_obj

object ilECSCommunity::$json_obj
protected

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

Referenced by __construct().

◆ $participants

array ilECSCommunity::$participants = array()
protected

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

◆ $position

int ilECSCommunity::$position = 0
protected

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

◆ $title

string ilECSCommunity::$title = ''
protected

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

Referenced by getTitle().


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