ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSCommunitiesCache Class Reference

+-----------------------------------------------------------------------——+ | ILIAS open source | +-----------------------------------------------------------------------——+ | Copyright (c) 1998-2006 ILIAS open source, University of Cologne | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. More...

+ Collaboration diagram for ilECSCommunitiesCache:

Public Member Functions

 getCommunities ()
 Get communities.
 lookupOwnId ($a_server_id, $a_mid)
 Lookup own mid of the community of a mid.
 lookupTitle ($a_server_id, $a_mid)
 Lookup community title.

Static Public Member Functions

static getInstance ()
 Singleton instance.
static delete ($a_server_id)
 Delete comunities by server id.

Protected Member Functions

 __construct ()
 Singleton constructor.

Private Member Functions

 read ()
 Read comunities.

Private Attributes

 $communities = array()

Static Private Attributes

static $instance = null

Detailed Description

+-----------------------------------------------------------------------——+ | ILIAS open source | +-----------------------------------------------------------------------——+ | Copyright (c) 1998-2006 ILIAS open source, University of Cologne | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version.

                  |

| | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | | | | You should have received a copy of the GNU General Public License | | along with this program; if not, write to the Free Software | | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +-----------------------------------------------------------------------——+

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

Definition at line 34 of file class.ilECSCommunitiesCache.php.

Constructor & Destructor Documentation

ilECSCommunitiesCache::__construct ( )
protected

Singleton constructor.

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

References read().

{
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilECSCommunitiesCache::delete (   $a_server_id)
static

Delete comunities by server id.

Parameters
<type>$a_server_id

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

References $ilDB, and $query.

{
global $ilDB;
$query = 'DELETE FROM ecs_community '.
'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
}
ilECSCommunitiesCache::getCommunities ( )

Get communities.

Returns
array ilECSCommunityCache

Definition at line 78 of file class.ilECSCommunitiesCache.php.

References $communities.

Referenced by lookupOwnId(), and lookupTitle().

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

+ Here is the caller graph for this function:

static ilECSCommunitiesCache::getInstance ( )
static

Singleton instance.

Returns
ilECSCommunitiesCache

Definition at line 52 of file class.ilECSCommunitiesCache.php.

References $instance.

Referenced by ilECSCategoryMappingRule\matches(), read(), and ilObjCourseGUI\updateECSExportSettings().

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

+ Here is the caller graph for this function:

ilECSCommunitiesCache::lookupOwnId (   $a_server_id,
  $a_mid 
)

Lookup own mid of the community of a mid.

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

References getCommunities().

{
foreach($this->getCommunities() as $com)
{
if($com->getServerId() == $a_server_id)
{
if(in_array($a_mid,$com->getMids()))
{
return $com->getOwnId();
}
}
}
return 0;
}

+ Here is the call graph for this function:

ilECSCommunitiesCache::lookupTitle (   $a_server_id,
  $a_mid 
)

Lookup community title.

Parameters
intserver_id
intmid

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

References getCommunities().

{
foreach($this->getCommunities() as $com)
{
if($com->getServerId() == $a_server_id)
{
if(in_array($a_mid, $com->getMids()))
{
return $com->getCommunityName();
}
}
}
return '';
}

+ Here is the call graph for this function:

ilECSCommunitiesCache::read ( )
private

Read comunities.

Definition at line 124 of file class.ilECSCommunitiesCache.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getInstance().

Referenced by __construct().

{
global $ilDB;
$query = 'SELECT sid,cid FROM ecs_community ';
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->communities[] = ilECSCommunityCache::getInstance($row->sid, $row->cid);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilECSCommunitiesCache::$communities = array()
private

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

Referenced by getCommunities().

ilECSCommunitiesCache::$instance = null
staticprivate

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

Referenced by getInstance().


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