ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSParticipantSetting Class Reference
+ Collaboration diagram for ilECSParticipantSetting:

Public Member Functions

 __construct ($a_server_id, $mid)
 Constructor.
 getServerId ()
 Get server id.
 setMid ($a_mid)
 getMid ()
 enableExport ($a_status)
 isExportEnabled ()
 enableImport ($a_status)
 isImportEnabled ()
 setImportType ($a_type)
 getImportType ()
 setTitle ($a_title)
 getTitle ()
 getCommunityName ()
 setCommunityName ($a_name)
 isTokenEnabled ()
 enableToken ($a_stat)
 setExportTypes ($a_types)
 getExportTypes ()
 setImportTypes ($a_types)
 isDeprecatedTokenEnabled ()
 enableDeprecatedToken ($a_stat)
 getImportTypes ()
 update ()
 Update Calls create automatically when no entry exists.
 delete ()
 Delete one participant entry <type> $ilDB.
 read ()
 Read stored entry.

Static Public Member Functions

static getInstance ($a_server_id, $mid)
 Get instance by server id and mid.
static deleteByServerId ($a_server_id)

Data Fields

const AUTH_VERSION_4 = 1
const AUTH_VERSION_5 = 2
const PERSON_EPPN = 1
const PERSON_LUID = 2
const PERSON_LOGIN = 3
const PERSON_UID = 4
const IMPORT_UNCHANGED = 0
const IMPORT_RCRS = 1
const IMPORT_CRS = 2
const IMPORT_CMS = 3

Static Protected Attributes

static $instances = array()

Private Member Functions

 exists ()
 create ()

Private Attributes

 $server_id = 0
 $mid = 0
 $export = false
 $import = false
 $import_type = 1
 $title = ''
 $cname = ''
 $token = true
 $dtoken = true
 $auth_version = self::AUTH_VERSION_4
 $person_type = self::PERSON_UID
 $export_types = array()
 $import_types = array()
 $exists = false

Detailed Description

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

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

Constructor & Destructor Documentation

ilECSParticipantSetting::__construct (   $a_server_id,
  $mid 
)

Constructor.

private

Definition at line 77 of file class.ilECSParticipantSetting.php.

References $mid, and read().

{
$this->server_id = $a_server_id;
$this->mid = $mid;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSParticipantSetting::create ( )
private

Definition at line 248 of file class.ilECSParticipantSetting.php.

References $ilDB, $query, getCommunityName(), getExportTypes(), getImportType(), getImportTypes(), getMid(), getServerId(), getTitle(), isDeprecatedTokenEnabled(), isExportEnabled(), isImportEnabled(), and isTokenEnabled().

Referenced by update().

{
global $ilDB;
$query = 'INSERT INTO ecs_part_settings '.
'(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) '.
'VALUES( '.
$ilDB->quote($this->getServerId(),'integer').', '.
$ilDB->quote($this->getMid(),'integer').', '.
$ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
$ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
$ilDB->quote((int) $this->getImportType(),'integer').', '.
$ilDB->quote($this->getTitle(),'text').', '.
$ilDB->quote($this->getCommunityName(),'text').', '.
$ilDB->quote($this->isTokenEnabled(),'integer').', '.
$ilDB->quote($this->isDeprecatedTokenEnabled(),'integer').', '.
$ilDB->quote(serialize($this->getExportTypes()),'text').', '.
$ilDB->quote(serialize($this->getImportTypes()),'text').' '.
')';
$aff = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSParticipantSetting::delete ( )

Delete one participant entry <type> $ilDB.

Returns
<type>

Definition at line 277 of file class.ilECSParticipantSetting.php.

References $ilDB, $query, getMid(), and getServerId().

Referenced by ilECSSettingsGUI\refreshParticipants().

{
global $ilDB;
$query = 'DELETE FROM ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
'AND mid = '.$ilDB->quote($this->getMid(),'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSParticipantSetting::deleteByServerId (   $a_server_id)
static

Definition at line 320 of file class.ilECSParticipantSetting.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

{
global $ilDB;
$query = 'DELETE FROM ecs_events'.
' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::enableDeprecatedToken (   $a_stat)

Definition at line 202 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->dtoken = $a_stat;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::enableExport (   $a_status)

Definition at line 119 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->export = $a_status;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::enableImport (   $a_status)

Definition at line 129 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->import = $a_status;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::enableToken (   $a_stat)

Definition at line 177 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->token = $a_stat;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::exists ( )
private

Definition at line 212 of file class.ilECSParticipantSetting.php.

References $exists.

Referenced by read(), and update().

{
return $this->exists;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getCommunityName ( )

Definition at line 162 of file class.ilECSParticipantSetting.php.

References $cname.

Referenced by create(), and update().

{
return $this->cname;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getExportTypes ( )

Definition at line 187 of file class.ilECSParticipantSetting.php.

References $export_types.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getImportType ( )

Definition at line 147 of file class.ilECSParticipantSetting.php.

References $import_type.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getImportTypes ( )

Definition at line 207 of file class.ilECSParticipantSetting.php.

References $import_types.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

static ilECSParticipantSetting::getInstance (   $a_server_id,
  $mid 
)
static

Get instance by server id and mid.

Parameters
type$a_server_id
type$mid
Returns
ilECSParticipantSetting

Definition at line 90 of file class.ilECSParticipantSetting.php.

References $mid.

Referenced by ilECSCmsCourseCommandQueueHandler\checkAllocationActivation(), and ilECSCmsCourseMemberCommandQueueHandler\checkAllocationActivation().

{
if(self::$instances[$a_server_id.'_'.$mid])
{
return self::$instances[$a_server_id.'_'.$mid];
}
return self::$instances[$a_server_id.'_'.$mid] = new self($a_server_id,$mid);
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getMid ( )

Definition at line 114 of file class.ilECSParticipantSetting.php.

References $mid.

Referenced by create(), delete(), read(), and update().

{
return $this->mid;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getServerId ( )

Get server id.

Returns
int

Definition at line 104 of file class.ilECSParticipantSetting.php.

References $server_id.

Referenced by create(), delete(), read(), and update().

{
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::getTitle ( )

Definition at line 157 of file class.ilECSParticipantSetting.php.

References $title.

Referenced by create(), and update().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::isDeprecatedTokenEnabled ( )

Definition at line 197 of file class.ilECSParticipantSetting.php.

References $dtoken.

Referenced by create(), and update().

{
return (bool) $this->dtoken;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::isExportEnabled ( )

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

References $export.

Referenced by create(), and update().

{
return (bool) $this->export;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::isImportEnabled ( )

Definition at line 134 of file class.ilECSParticipantSetting.php.

References $import.

Referenced by create(), and update().

{
return $this->import;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::isTokenEnabled ( )

Definition at line 172 of file class.ilECSParticipantSetting.php.

References $token.

Referenced by create(), and update().

{
return (bool) $this->token;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::read ( )

Read stored entry.

Returns
<type>

Definition at line 292 of file class.ilECSParticipantSetting.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, enableDeprecatedToken(), enableExport(), enableImport(), enableToken(), exists(), getMid(), getServerId(), setCommunityName(), setExportTypes(), setImportType(), setImportTypes(), and setTitle().

Referenced by __construct().

{
global $ilDB;
$query = 'SELECT * FROM ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
'AND mid = '.$ilDB->quote($this->getMid(),'integer');
$res = $ilDB->query($query);
$this->exists = ($res->numRows() ? true : false);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->enableExport($row->export);
$this->enableImport($row->import);
$this->setImportType($row->import_type);
$this->setTitle($row->title);
$this->setCommunityName($row->cname);
$this->enableToken($row->token);
$this->enableDeprecatedToken($row->dtoken);
$this->setExportTypes((array) unserialize($row->export_types));
$this->setImportTypes((array) unserialize($row->import_types));
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSParticipantSetting::setCommunityName (   $a_name)

Definition at line 167 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->cname = $a_name;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::setExportTypes (   $a_types)

Definition at line 182 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->export_types = $a_types;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::setImportType (   $a_type)

Definition at line 139 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
if($a_type != self::IMPORT_UNCHANGED)
{
$this->import_type = $a_type;
}
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::setImportTypes (   $a_types)

Definition at line 192 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->import_types = $a_types;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::setMid (   $a_mid)

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

{
$this->mid = $a_mid;
}
ilECSParticipantSetting::setTitle (   $a_title)

Definition at line 152 of file class.ilECSParticipantSetting.php.

Referenced by read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilECSParticipantSetting::update ( )

Update Calls create automatically when no entry exists.

Definition at line 221 of file class.ilECSParticipantSetting.php.

References $ilDB, $query, create(), exists(), getCommunityName(), getExportTypes(), getImportType(), getImportTypes(), getMid(), getServerId(), getTitle(), isDeprecatedTokenEnabled(), isExportEnabled(), isImportEnabled(), and isTokenEnabled().

{
global $ilDB;
if(!$this->exists())
{
return $this->create();
}
$query = 'UPDATE ecs_part_settings '.
'SET '.
'sid = '.$ilDB->quote((int) $this->getServerId(),'integer').', '.
'mid = '.$ilDB->quote((int) $this->getMid(),'integer').', '.
'export = '.$ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
'import = '.$ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
'import_type = '.$ilDB->quote((int) $this->getImportType(),'integer').', '.
'title = '.$ilDB->quote($this->getTitle(),'text').', '.
'cname = '.$ilDB->quote($this->getCommunityName(),'text').', '.
'token = '.$ilDB->quote($this->isTokenEnabled(),'integer').', '.
'dtoken = '.$ilDB->quote($this->isDeprecatedTokenEnabled(),'integer').', '.
'export_types = '.$ilDB->quote(serialize($this->getExportTypes()),'text').', '.
'import_types = '.$ilDB->quote(serialize($this->getImportTypes()),'text').' '.
'WHERE sid = '.$ilDB->quote((int) $this->getServerId(),'integer').' '.
'AND mid = '.$ilDB->quote((int) $this->getMid(),'integer');
$aff = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilECSParticipantSetting::$auth_version = self::AUTH_VERSION_4
private

Definition at line 61 of file class.ilECSParticipantSetting.php.

ilECSParticipantSetting::$cname = ''
private

Definition at line 57 of file class.ilECSParticipantSetting.php.

Referenced by getCommunityName().

ilECSParticipantSetting::$dtoken = true
private

Definition at line 59 of file class.ilECSParticipantSetting.php.

Referenced by isDeprecatedTokenEnabled().

ilECSParticipantSetting::$exists = false
private

Definition at line 68 of file class.ilECSParticipantSetting.php.

Referenced by exists().

ilECSParticipantSetting::$export = false
private

Definition at line 53 of file class.ilECSParticipantSetting.php.

Referenced by isExportEnabled().

ilECSParticipantSetting::$export_types = array()
private

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

Referenced by getExportTypes().

ilECSParticipantSetting::$import = false
private

Definition at line 54 of file class.ilECSParticipantSetting.php.

Referenced by isImportEnabled().

ilECSParticipantSetting::$import_type = 1
private

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

Referenced by getImportType().

ilECSParticipantSetting::$import_types = array()
private

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

Referenced by getImportTypes().

ilECSParticipantSetting::$instances = array()
staticprotected

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

ilECSParticipantSetting::$mid = 0
private

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

Referenced by __construct(), getInstance(), and getMid().

ilECSParticipantSetting::$person_type = self::PERSON_UID
private

Definition at line 62 of file class.ilECSParticipantSetting.php.

ilECSParticipantSetting::$server_id = 0
private

Definition at line 51 of file class.ilECSParticipantSetting.php.

Referenced by getServerId().

ilECSParticipantSetting::$title = ''
private

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

Referenced by getTitle().

ilECSParticipantSetting::$token = true
private

Definition at line 58 of file class.ilECSParticipantSetting.php.

Referenced by isTokenEnabled().

const ilECSParticipantSetting::AUTH_VERSION_4 = 1

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

const ilECSParticipantSetting::AUTH_VERSION_5 = 2

Definition at line 35 of file class.ilECSParticipantSetting.php.

const ilECSParticipantSetting::IMPORT_CMS = 3
const ilECSParticipantSetting::IMPORT_CRS = 2

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

Referenced by ilECSCommunityTableGUI\fillRow().

const ilECSParticipantSetting::IMPORT_RCRS = 1

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

Referenced by ilECSCommunityTableGUI\fillRow().

const ilECSParticipantSetting::IMPORT_UNCHANGED = 0
const ilECSParticipantSetting::PERSON_EPPN = 1

Definition at line 37 of file class.ilECSParticipantSetting.php.

const ilECSParticipantSetting::PERSON_LOGIN = 3

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

const ilECSParticipantSetting::PERSON_LUID = 2

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

const ilECSParticipantSetting::PERSON_UID = 4

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


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