ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilECSParticipantSetting Class Reference
+ Collaboration diagram for ilECSParticipantSetting:

Public Member Functions

 __construct ($a_server_id, $mid)
 Constructor. More...
 
 getServerId ()
 Get server id. More...
 
 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. More...
 
 delete ()
 Delete one participant entry <type> $ilDB. More...
 
 read ()
 Read stored entry. More...
 

Static Public Member Functions

static getInstance ($a_server_id, $mid)
 Get instance by server id and mid. More...
 
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

◆ __construct()

ilECSParticipantSetting::__construct (   $a_server_id,
  $mid 
)

Constructor.

private

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

References $mid, and read().

78  {
79  $this->server_id = $a_server_id;
80  $this->mid = $mid;
81  $this->read();
82  }
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

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().

249  {
250  global $ilDB;
251 
252  $query = 'INSERT INTO ecs_part_settings '.
253  '(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) '.
254  'VALUES( '.
255  $ilDB->quote($this->getServerId(),'integer').', '.
256  $ilDB->quote($this->getMid(),'integer').', '.
257  $ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
258  $ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
259  $ilDB->quote((int) $this->getImportType(),'integer').', '.
260  $ilDB->quote($this->getTitle(),'text').', '.
261  $ilDB->quote($this->getCommunityName(),'text').', '.
262  $ilDB->quote($this->isTokenEnabled(),'integer').', '.
263  $ilDB->quote($this->isDeprecatedTokenEnabled(),'integer').', '.
264  $ilDB->quote(serialize($this->getExportTypes()),'text').', '.
265  $ilDB->quote(serialize($this->getImportTypes()),'text').' '.
266  ')';
267  $aff = $ilDB->manipulate($query);
268  return true;
269 
270  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

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().

278  {
279  global $ilDB;
280 
281  $query = 'DELETE FROM ecs_part_settings '.
282  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
283  'AND mid = '.$ilDB->quote($this->getMid(),'integer');
284  $ilDB->manipulate($query);
285  return true;
286  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSParticipantSetting::deleteByServerId (   $a_server_id)
static

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

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

321  {
322  global $ilDB;
323 
324  $query = 'DELETE FROM ecs_events'.
325  ' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
326  $ilDB->manipulate($query);
327  return true;
328  }
global $ilDB
+ Here is the caller graph for this function:

◆ enableDeprecatedToken()

ilECSParticipantSetting::enableDeprecatedToken (   $a_stat)

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

Referenced by read().

203  {
204  $this->dtoken = $a_stat;
205  }
+ Here is the caller graph for this function:

◆ enableExport()

ilECSParticipantSetting::enableExport (   $a_status)

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

References export.

Referenced by read().

120  {
121  $this->export = $a_status;
122  }
Removing first two heading rows for CSV export
Definition: 26utf8.php:79
+ Here is the caller graph for this function:

◆ enableImport()

ilECSParticipantSetting::enableImport (   $a_status)

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

Referenced by read().

130  {
131  $this->import = $a_status;
132  }
+ Here is the caller graph for this function:

◆ enableToken()

ilECSParticipantSetting::enableToken (   $a_stat)

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

Referenced by read().

178  {
179  $this->token = $a_stat;
180  }
+ Here is the caller graph for this function:

◆ exists()

ilECSParticipantSetting::exists ( )
private

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

References $exists.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ getCommunityName()

ilECSParticipantSetting::getCommunityName ( )

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

References $cname.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getExportTypes()

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:

◆ getImportType()

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:

◆ getImportTypes()

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:

◆ getInstance()

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().

91  {
92  if(self::$instances[$a_server_id.'_'.$mid])
93  {
94  return self::$instances[$a_server_id.'_'.$mid];
95  }
96  return self::$instances[$a_server_id.'_'.$mid] = new self($a_server_id,$mid);
97  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSParticipantSetting::getMid ( )

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

References $mid.

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

+ Here is the caller graph for this function:

◆ getServerId()

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:

◆ getTitle()

ilECSParticipantSetting::getTitle ( )

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

References $title.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ isDeprecatedTokenEnabled()

ilECSParticipantSetting::isDeprecatedTokenEnabled ( )

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

References $dtoken.

Referenced by create(), and update().

198  {
199  return (bool) $this->dtoken;
200  }
+ Here is the caller graph for this function:

◆ isExportEnabled()

ilECSParticipantSetting::isExportEnabled ( )

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

References $export.

Referenced by create(), and update().

125  {
126  return (bool) $this->export;
127  }
+ Here is the caller graph for this function:

◆ isImportEnabled()

ilECSParticipantSetting::isImportEnabled ( )

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

References $import.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ isTokenEnabled()

ilECSParticipantSetting::isTokenEnabled ( )

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

References $token.

Referenced by create(), and update().

173  {
174  return (bool) $this->token;
175  }
+ Here is the caller graph for this function:

◆ read()

ilECSParticipantSetting::read ( )

Read stored entry.

Returns
<type>

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

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

Referenced by __construct().

293  {
294  global $ilDB;
295 
296  $query = 'SELECT * FROM ecs_part_settings '.
297  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
298  'AND mid = '.$ilDB->quote($this->getMid(),'integer');
299 
300  $res = $ilDB->query($query);
301 
302  $this->exists = ($res->numRows() ? true : false);
303 
304  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
305  {
306  $this->enableExport($row->export);
307  $this->enableImport($row->import);
308  $this->setImportType($row->import_type);
309  $this->setTitle($row->title);
310  $this->setCommunityName($row->cname);
311  $this->enableToken($row->token);
312  $this->enableDeprecatedToken($row->dtoken);
313 
314  $this->setExportTypes((array) unserialize($row->export_types));
315  $this->setImportTypes((array) unserialize($row->import_types));
316  }
317  return true;
318  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCommunityName()

ilECSParticipantSetting::setCommunityName (   $a_name)

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

Referenced by read().

168  {
169  $this->cname = $a_name;
170  }
+ Here is the caller graph for this function:

◆ setExportTypes()

ilECSParticipantSetting::setExportTypes (   $a_types)

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

Referenced by read().

183  {
184  $this->export_types = $a_types;
185  }
+ Here is the caller graph for this function:

◆ setImportType()

ilECSParticipantSetting::setImportType (   $a_type)

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

References $a_type.

Referenced by read().

140  {
141  if($a_type != self::IMPORT_UNCHANGED)
142  {
143  $this->import_type = $a_type;
144  }
145  }
$a_type
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ setImportTypes()

ilECSParticipantSetting::setImportTypes (   $a_types)

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

Referenced by read().

193  {
194  $this->import_types = $a_types;
195  }
+ Here is the caller graph for this function:

◆ setMid()

ilECSParticipantSetting::setMid (   $a_mid)

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

110  {
111  $this->mid = $a_mid;
112  }

◆ setTitle()

ilECSParticipantSetting::setTitle (   $a_title)

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

Referenced by read().

153  {
154  $this->title = $a_title;
155  }
+ Here is the caller graph for this function:

◆ update()

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().

222  {
223  global $ilDB;
224 
225  if(!$this->exists())
226  {
227  return $this->create();
228  }
229  $query = 'UPDATE ecs_part_settings '.
230  'SET '.
231  'sid = '.$ilDB->quote((int) $this->getServerId(),'integer').', '.
232  'mid = '.$ilDB->quote((int) $this->getMid(),'integer').', '.
233  'export = '.$ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
234  'import = '.$ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
235  'import_type = '.$ilDB->quote((int) $this->getImportType(),'integer').', '.
236  'title = '.$ilDB->quote($this->getTitle(),'text').', '.
237  'cname = '.$ilDB->quote($this->getCommunityName(),'text').', '.
238  'token = '.$ilDB->quote($this->isTokenEnabled(),'integer').', '.
239  'dtoken = '.$ilDB->quote($this->isDeprecatedTokenEnabled(),'integer').', '.
240  'export_types = '.$ilDB->quote(serialize($this->getExportTypes()),'text').', '.
241  'import_types = '.$ilDB->quote(serialize($this->getImportTypes()),'text').' '.
242  'WHERE sid = '.$ilDB->quote((int) $this->getServerId(),'integer').' '.
243  'AND mid = '.$ilDB->quote((int) $this->getMid(),'integer');
244  $aff = $ilDB->manipulate($query);
245  return true;
246  }
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $auth_version

ilECSParticipantSetting::$auth_version = self::AUTH_VERSION_4
private

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

◆ $cname

ilECSParticipantSetting::$cname = ''
private

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

Referenced by getCommunityName().

◆ $dtoken

ilECSParticipantSetting::$dtoken = true
private

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

Referenced by isDeprecatedTokenEnabled().

◆ $exists

ilECSParticipantSetting::$exists = false
private

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

Referenced by exists().

◆ $export

ilECSParticipantSetting::$export = false
private

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

Referenced by isExportEnabled().

◆ $export_types

ilECSParticipantSetting::$export_types = array()
private

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

Referenced by getExportTypes().

◆ $import

ilECSParticipantSetting::$import = false
private

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

Referenced by isImportEnabled().

◆ $import_type

ilECSParticipantSetting::$import_type = 1
private

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

Referenced by getImportType().

◆ $import_types

ilECSParticipantSetting::$import_types = array()
private

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

Referenced by getImportTypes().

◆ $instances

ilECSParticipantSetting::$instances = array()
staticprotected

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

◆ $mid

ilECSParticipantSetting::$mid = 0
private

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

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

◆ $person_type

ilECSParticipantSetting::$person_type = self::PERSON_UID
private

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

◆ $server_id

ilECSParticipantSetting::$server_id = 0
private

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

Referenced by getServerId().

◆ $title

ilECSParticipantSetting::$title = ''
private

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

Referenced by getTitle().

◆ $token

ilECSParticipantSetting::$token = true
private

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

Referenced by isTokenEnabled().

◆ AUTH_VERSION_4

const ilECSParticipantSetting::AUTH_VERSION_4 = 1

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

◆ AUTH_VERSION_5

const ilECSParticipantSetting::AUTH_VERSION_5 = 2

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

◆ IMPORT_CMS

const ilECSParticipantSetting::IMPORT_CMS = 3

◆ IMPORT_CRS

const ilECSParticipantSetting::IMPORT_CRS = 2

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

Referenced by ilECSCommunityTableGUI\fillRow().

◆ IMPORT_RCRS

const ilECSParticipantSetting::IMPORT_RCRS = 1

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

Referenced by ilECSCommunityTableGUI\fillRow().

◆ IMPORT_UNCHANGED

const ilECSParticipantSetting::IMPORT_UNCHANGED = 0

◆ PERSON_EPPN

const ilECSParticipantSetting::PERSON_EPPN = 1

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

◆ PERSON_LOGIN

const ilECSParticipantSetting::PERSON_LOGIN = 3

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

◆ PERSON_LUID

const ilECSParticipantSetting::PERSON_LUID = 2

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

◆ PERSON_UID

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: