ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 245 of file class.ilECSParticipantSetting.php.

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

Referenced by update().

246  {
247  global $ilDB;
248 
249  $query = 'INSERT INTO ecs_part_settings ' .
250  '(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) ' .
251  'VALUES( ' .
252  $ilDB->quote($this->getServerId(), 'integer') . ', ' .
253  $ilDB->quote($this->getMid(), 'integer') . ', ' .
254  $ilDB->quote((int) $this->isExportEnabled(), 'integer') . ', ' .
255  $ilDB->quote((int) $this->isImportEnabled(), 'integer') . ', ' .
256  $ilDB->quote((int) $this->getImportType(), 'integer') . ', ' .
257  $ilDB->quote($this->getTitle(), 'text') . ', ' .
258  $ilDB->quote($this->getCommunityName(), 'text') . ', ' .
259  $ilDB->quote($this->isTokenEnabled(), 'integer') . ', ' .
260  $ilDB->quote($this->isDeprecatedTokenEnabled(), 'integer') . ', ' .
261  $ilDB->quote(serialize($this->getExportTypes()), 'text') . ', ' .
262  $ilDB->quote(serialize($this->getImportTypes()), 'text') . ' ' .
263  ')';
264  $aff = $ilDB->manipulate($query);
265  return true;
266  }
$query
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 273 of file class.ilECSParticipantSetting.php.

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

Referenced by ilECSSettingsGUI\refreshParticipants().

274  {
275  global $ilDB;
276 
277  $query = 'DELETE FROM ecs_part_settings ' .
278  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
279  'AND mid = ' . $ilDB->quote($this->getMid(), 'integer');
280  $ilDB->manipulate($query);
281  return true;
282  }
$query
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 315 of file class.ilECSParticipantSetting.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

316  {
317  global $ilDB;
318 
319  $query = 'DELETE FROM ecs_events' .
320  ' WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
321  $ilDB->manipulate($query);
322  return true;
323  }
$query
global $ilDB
+ Here is the caller graph for this function:

◆ enableDeprecatedToken()

ilECSParticipantSetting::enableDeprecatedToken (   $a_stat)

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

Referenced by read().

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

◆ enableExport()

ilECSParticipantSetting::enableExport (   $a_status)

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

References export.

Referenced by read().

119  {
120  $this->export = $a_status;
121  }
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 128 of file class.ilECSParticipantSetting.php.

Referenced by read().

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

◆ enableToken()

ilECSParticipantSetting::enableToken (   $a_stat)

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

Referenced by read().

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

◆ exists()

ilECSParticipantSetting::exists ( )
private

Definition at line 210 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 160 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 185 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 145 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 205 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  return self::$instances[$a_server_id . '_' . $mid];
94  }
95  return self::$instances[$a_server_id . '_' . $mid] = new self($a_server_id, $mid);
96  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSParticipantSetting::getMid ( )

Definition at line 113 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 103 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 155 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 195 of file class.ilECSParticipantSetting.php.

References $dtoken.

Referenced by create(), and update().

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

◆ isExportEnabled()

ilECSParticipantSetting::isExportEnabled ( )

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

References $export.

Referenced by create(), and update().

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

◆ isImportEnabled()

ilECSParticipantSetting::isImportEnabled ( )

Definition at line 133 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 170 of file class.ilECSParticipantSetting.php.

References $token.

Referenced by create(), and update().

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

◆ read()

ilECSParticipantSetting::read ( )

Read stored entry.

Returns
<type>

Definition at line 288 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().

289  {
290  global $ilDB;
291 
292  $query = 'SELECT * FROM ecs_part_settings ' .
293  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
294  'AND mid = ' . $ilDB->quote($this->getMid(), 'integer');
295 
296  $res = $ilDB->query($query);
297 
298  $this->exists = ($res->numRows() ? true : false);
299 
300  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
301  $this->enableExport($row->export);
302  $this->enableImport($row->import);
303  $this->setImportType($row->import_type);
304  $this->setTitle($row->title);
305  $this->setCommunityName($row->cname);
306  $this->enableToken($row->token);
307  $this->enableDeprecatedToken($row->dtoken);
308 
309  $this->setExportTypes((array) unserialize($row->export_types));
310  $this->setImportTypes((array) unserialize($row->import_types));
311  }
312  return true;
313  }
foreach($_POST as $key=> $value) $res
$query
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 165 of file class.ilECSParticipantSetting.php.

Referenced by read().

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

◆ setExportTypes()

ilECSParticipantSetting::setExportTypes (   $a_types)

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

Referenced by read().

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

◆ setImportType()

ilECSParticipantSetting::setImportType (   $a_type)

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

References $a_type.

Referenced by read().

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

◆ setImportTypes()

ilECSParticipantSetting::setImportTypes (   $a_types)

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

Referenced by read().

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

◆ setMid()

ilECSParticipantSetting::setMid (   $a_mid)

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

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

◆ setTitle()

ilECSParticipantSetting::setTitle (   $a_title)

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

Referenced by read().

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

◆ update()

ilECSParticipantSetting::update ( )

Update Calls create automatically when no entry exists.

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

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

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