ILIAS  release_4-4 Revision
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)
 
 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 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 = ''
 
 $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 61 of file class.ilECSParticipantSetting.php.

References $mid, and read().

62  {
63  $this->server_id = $a_server_id;
64  $this->mid = $mid;
65  $this->read();
66  }
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSParticipantSetting::create ( )
private

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

References $query, getCommunityName(), getImportType(), getMid(), getServerId(), getTitle(), isExportEnabled(), and isImportEnabled().

Referenced by update().

189  {
190  global $ilDB;
191 
192  $query = 'INSERT INTO ecs_part_settings '.
193  '(sid,mid,export,import,import_type,title,cname) '.
194  'VALUES( '.
195  $ilDB->quote($this->getServerId(),'integer').', '.
196  $ilDB->quote($this->getMid(),'integer').', '.
197  $ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
198  $ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
199  $ilDB->quote((int) $this->getImportType(),'integer').', '.
200  $ilDB->quote($this->getTitle(),'text').', '.
201  $ilDB->quote($this->getCommunityName(),'text').' '.
202  ')';
203  $aff = $ilDB->manipulate($query);
204  return true;
205 
206  }
+ 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 213 of file class.ilECSParticipantSetting.php.

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

Referenced by ilECSSettingsGUI\refreshParticipants().

214  {
215  global $ilDB;
216 
217  $query = 'DELETE FROM ecs_part_settings '.
218  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
219  'AND mid = '.$ilDB->quote($this->getMid(),'integer');
220  $ilDB->manipulate($query);
221  return true;
222  }
+ 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 251 of file class.ilECSParticipantSetting.php.

References $query.

Referenced by ilECSSetting\delete().

252  {
253  global $ilDB;
254 
255  $query = 'DELETE FROM ecs_events'.
256  ' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
257  $ilDB->manipulate($query);
258  return true;
259  }
+ Here is the caller graph for this function:

◆ enableExport()

ilECSParticipantSetting::enableExport (   $a_status)

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

Referenced by read().

104  {
105  $this->export = $a_status;
106  }
+ Here is the caller graph for this function:

◆ enableImport()

ilECSParticipantSetting::enableImport (   $a_status)

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

Referenced by read().

114  {
115  $this->import = $a_status;
116  }
+ Here is the caller graph for this function:

◆ exists()

ilECSParticipantSetting::exists ( )
private

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

References $cname.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getImportType()

ilECSParticipantSetting::getImportType ( )

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

References $import_type.

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 74 of file class.ilECSParticipantSetting.php.

References $mid.

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

75  {
76  if(self::$instances[$a_server_id.'_'.$mid])
77  {
78  return self::$instances[$a_server_id.'_'.$mid];
79  }
80  return self::$instances[$a_server_id.'_'.$mid] = new self($a_server_id,$mid);
81  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSParticipantSetting::getMid ( )

Definition at line 98 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 88 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 141 of file class.ilECSParticipantSetting.php.

References $title.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ isExportEnabled()

ilECSParticipantSetting::isExportEnabled ( )

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

References $export.

Referenced by create(), and update().

109  {
110  return (bool) $this->export;
111  }
+ Here is the caller graph for this function:

◆ isImportEnabled()

ilECSParticipantSetting::isImportEnabled ( )

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

References $import.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ read()

ilECSParticipantSetting::read ( )

Read stored entry.

Returns
<type>

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

References $query, $res, $row, DB_FETCHMODE_OBJECT, enableExport(), enableImport(), exists(), getMid(), getServerId(), setCommunityName(), setImportType(), and setTitle().

Referenced by __construct().

229  {
230  global $ilDB;
231 
232  $query = 'SELECT * FROM ecs_part_settings '.
233  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
234  'AND mid = '.$ilDB->quote($this->getMid(),'integer');
235 
236  $res = $ilDB->query($query);
237 
238  $this->exists = ($res->numRows() ? true : false);
239 
240  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
241  {
242  $this->enableExport($row->export);
243  $this->enableImport($row->import);
244  $this->setImportType($row->import_type);
245  $this->setTitle($row->title);
246  $this->setCommunityName($row->cname);
247  }
248  return true;
249  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCommunityName()

ilECSParticipantSetting::setCommunityName (   $a_name)

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

Referenced by read().

152  {
153  $this->cname = $a_name;
154  }
+ Here is the caller graph for this function:

◆ setImportType()

ilECSParticipantSetting::setImportType (   $a_type)

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

Referenced by read().

124  {
125  if($a_type != self::IMPORT_UNCHANGED)
126  {
127  $this->import_type = $a_type;
128  }
129  }
+ Here is the caller graph for this function:

◆ setMid()

ilECSParticipantSetting::setMid (   $a_mid)

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

94  {
95  $this->mid = $a_mid;
96  }

◆ setTitle()

ilECSParticipantSetting::setTitle (   $a_title)

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

Referenced by read().

137  {
138  $this->title = $a_title;
139  }
+ Here is the caller graph for this function:

◆ update()

ilECSParticipantSetting::update ( )

Update Calls create automatically when no entry exists.

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

References $query, create(), exists(), getCommunityName(), getImportType(), getMid(), getServerId(), getTitle(), isExportEnabled(), and isImportEnabled().

166  {
167  global $ilDB;
168 
169  if(!$this->exists())
170  {
171  return $this->create();
172  }
173  $query = 'UPDATE ecs_part_settings '.
174  'SET '.
175  'sid = '.$ilDB->quote((int) $this->getServerId(),'integer').', '.
176  'mid = '.$ilDB->quote((int) $this->getMid(),'integer').', '.
177  'export = '.$ilDB->quote((int) $this->isExportEnabled(),'integer').', '.
178  'import = '.$ilDB->quote((int) $this->isImportEnabled(),'integer').', '.
179  'import_type = '.$ilDB->quote((int) $this->getImportType(),'integer').', '.
180  'title = '.$ilDB->quote($this->getTitle(),'text').', '.
181  'cname = '.$ilDB->quote($this->getCommunityName(),'text').' '.
182  'WHERE sid = '.$ilDB->quote((int) $this->getServerId(),'integer').' '.
183  'AND mid = '.$ilDB->quote((int) $this->getMid(),'integer');
184  $aff = $ilDB->manipulate($query);
185  return true;
186  }
+ Here is the call graph for this function:

Field Documentation

◆ $cname

ilECSParticipantSetting::$cname = ''
private

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

Referenced by getCommunityName().

◆ $exists

ilECSParticipantSetting::$exists = false
private

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

Referenced by exists().

◆ $export

ilECSParticipantSetting::$export = false
private

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

Referenced by isExportEnabled().

◆ $import

ilECSParticipantSetting::$import = false
private

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

Referenced by isImportEnabled().

◆ $import_type

ilECSParticipantSetting::$import_type = 1
private

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

Referenced by getImportType().

◆ $instances

ilECSParticipantSetting::$instances = array()
staticprotected

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

◆ $mid

ilECSParticipantSetting::$mid = 0
private

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

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

◆ $server_id

ilECSParticipantSetting::$server_id = 0
private

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

Referenced by getServerId().

◆ $title

ilECSParticipantSetting::$title = ''
private

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

Referenced by getTitle().

◆ IMPORT_CMS

const ilECSParticipantSetting::IMPORT_CMS = 3

◆ IMPORT_CRS

const ilECSParticipantSetting::IMPORT_CRS = 2

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

Referenced by ilECSCommunityTableGUI\fillRow().

◆ IMPORT_RCRS

const ilECSParticipantSetting::IMPORT_RCRS = 1

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

Referenced by ilECSCommunityTableGUI\fillRow().

◆ IMPORT_UNCHANGED

const ilECSParticipantSetting::IMPORT_UNCHANGED = 0

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