ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSCommunityReader Class Reference
+ Collaboration diagram for ilECSCommunityReader:

Public Member Functions

 getOwnMIDs ()
 get publishable ids
 getCommunities ()
 get communities
 getCommunityById ($a_id)
 get community by id
 getParticipantByMID ($a_mid)
 get participant by id
 getPublishableParticipants ()
 get publishable communities
 getEnabledParticipants ()
 get enabled participants

Static Public Member Functions

static _getInstance ()
 get singleton instance

Protected Attributes

 $position = 0
 $log
 $settings = null
 $connector = null
 $communities = array()
 $participants = array()
 $own_ids = array()

Private Member Functions

 __construct ()
 Singleton constructor.
 read ()
 parse

Static Private Attributes

static $instance = null

Detailed Description

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

Definition at line 36 of file class.ilECSCommunityReader.php.

Constructor & Destructor Documentation

ilECSCommunityReader::__construct ( )
private

Singleton constructor.

private

Exceptions
ilECSConnectorException

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

References $ilLog, _getInstance(), and read().

{
global $ilLog;
include_once('Services/WebServices/ECS/classes/class.ilECSSettings.php');
include_once('Services/WebServices/ECS/classes/class.ilECSConnector.php');
include_once('Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
include_once('Services/WebServices/ECS/classes/class.ilECSCommunity.php');
$this->settings = ilECSSettings::_getInstance();
$this->connector = new ilECSConnector();
$this->log = $ilLog;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilECSCommunityReader::_getInstance ( )
static

get singleton instance

public

Definition at line 79 of file class.ilECSCommunityReader.php.

References $instance.

Referenced by __construct(), ilECSSettingsGUI\communities(), ilECSSettingsGUI\exportImported(), ilObjCourseGUI\fillECSExportSettings(), ilECSAuth\init(), ilECSUtils\lookupParticipantName(), ilECSImportedContentTableGUI\parse(), and ilECSContentWriter\sendNewContentNotification().

{
if(self::$instance)
{
}
return self::$instance = new ilECSCommunityReader();
}

+ Here is the caller graph for this function:

ilECSCommunityReader::getCommunities ( )

get communities

public

Parameters

Definition at line 106 of file class.ilECSCommunityReader.php.

Referenced by getEnabledParticipants(), and getPublishableParticipants().

{
return $this->communities ? $this->communities : array();
}

+ Here is the caller graph for this function:

ilECSCommunityReader::getCommunityById (   $a_id)

get community by id

public

Parameters
intcomm_id

Definition at line 118 of file class.ilECSCommunityReader.php.

{
foreach($this->communities as $community)
{
if($community->getId() == $a_id)
{
return $community;
}
}
return null;
}
ilECSCommunityReader::getEnabledParticipants ( )

get enabled participants

public

Definition at line 169 of file class.ilECSCommunityReader.php.

References getCommunities().

{
foreach($this->getCommunities() as $community)
{
foreach($community->getParticipants() as $participant)
{
if($participant->isEnabled())
{
$e_part[] = $participant;
}
}
}
return $e_part ? $e_part : array();
}

+ Here is the call graph for this function:

ilECSCommunityReader::getOwnMIDs ( )

get publishable ids

public

Definition at line 94 of file class.ilECSCommunityReader.php.

{
return $this->own_ids ? $this->own_ids : array();
}
ilECSCommunityReader::getParticipantByMID (   $a_mid)

get participant by id

public

Parameters
intmid

Definition at line 136 of file class.ilECSCommunityReader.php.

{
return isset($this->participants[$a_mid]) ? $this->participants[$a_mid] : false;
}
ilECSCommunityReader::getPublishableParticipants ( )

get publishable communities

public

Definition at line 148 of file class.ilECSCommunityReader.php.

References getCommunities().

{
foreach($this->getCommunities() as $community)
{
foreach($community->getParticipants() as $participant)
{
if($participant->isPublishable())
{
$p_part[] = $participant;
}
}
}
return $p_part ? $p_part : array();
}

+ Here is the call graph for this function:

ilECSCommunityReader::read ( )
private

parse

private

Parameters

Definition at line 191 of file class.ilECSCommunityReader.php.

References $ilLog, and $res.

Referenced by __construct().

{
global $ilLog;
try
{
$res = $this->connector->getMemberships();
if(!is_array($res->getResult()))
{
return false;
}
foreach($res->getResult() as $community)
{
$tmp_comm = new ilECSCommunity($community);
foreach($tmp_comm->getParticipants() as $participant)
{
$this->participants[$participant->getMID()] = $participant;
if($participant->isSelf())
{
$this->own_ids[] = $participant->getMID();
}
}
$this->communities[] = $tmp_comm;
}
}
{
$ilLog->write(__METHOD__.': Error connecting to ECS server. '.$e->getMessage());
throw $e;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilECSCommunityReader::$communities = array()
protected

Definition at line 46 of file class.ilECSCommunityReader.php.

ilECSCommunityReader::$connector = null
protected

Definition at line 44 of file class.ilECSCommunityReader.php.

ilECSCommunityReader::$instance = null
staticprivate

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

Referenced by _getInstance().

ilECSCommunityReader::$log
protected

Definition at line 42 of file class.ilECSCommunityReader.php.

ilECSCommunityReader::$own_ids = array()
protected

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

ilECSCommunityReader::$participants = array()
protected

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

ilECSCommunityReader::$position = 0
protected

Definition at line 40 of file class.ilECSCommunityReader.php.

ilECSCommunityReader::$settings = null
protected

Definition at line 43 of file class.ilECSCommunityReader.php.


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