ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCGroup Class Reference

Defines a system check group including different tasks of a component. More...

+ Collaboration diagram for ilSCGroup:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 getId ()
 
 setComponentId ($a_comp)
 
 getComponentId ()
 Get component. More...
 
 setLastUpdate (ilDateTime $a_update)
 
 getLastUpdate ()
 Get last update date. More...
 
 setStatus ($a_status)
 
 getStatus ()
 Get status. More...
 
 read ()
 Read group. More...
 
 create ()
 Create new group. More...
 

Static Public Member Functions

static lookupComponent ($a_id)
 lookup component by id type $ilDB More...
 

Private Attributes

 $id = 0
 
 $component_id = ''
 
 $component_type = ''
 
 $last_update = null
 
 $status = 0
 

Detailed Description

Defines a system check group including different tasks of a component.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 12 of file class.ilSCGroup.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCGroup::__construct (   $a_id = 0)

Constructor.

Parameters
type$a_id

Definition at line 25 of file class.ilSCGroup.php.

References read().

26  {
27  $this->id = $a_id;
28  $this->read();
29  }
read()
Read group.
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilSCGroup::create ( )

Create new group.

Definition at line 127 of file class.ilSCGroup.php.

References $ilDB, $query, getComponentId(), getId(), and getStatus().

128  {
129  global $ilDB;
130 
131  $this->id = $ilDB->nextId('sysc_groups');
132 
133  $query = 'INSERT INTO sysc_groups (id,component,status) ' .
134  'VALUES ( ' .
135  $ilDB->quote($this->getId(), 'integer') . ', ' .
136  $ilDB->quote($this->getComponentId(), 'text') . ', ' .
137  $ilDB->quote($this->getStatus(), 'integer') . ' ' .
138  ')';
139  $ilDB->manipulate($query);
140  return $this->getId();
141  }
getComponentId()
Get component.
getStatus()
Get status.
$query
global $ilDB
+ Here is the call graph for this function:

◆ getComponentId()

ilSCGroup::getComponentId ( )

Get component.

Returns
string

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

References $component_id.

Referenced by create().

66  {
67  return $this->component_id;
68  }
+ Here is the caller graph for this function:

◆ getId()

ilSCGroup::getId ( )

Definition at line 50 of file class.ilSCGroup.php.

References $id.

Referenced by create(), and read().

51  {
52  return $this->id;
53  }
+ Here is the caller graph for this function:

◆ getLastUpdate()

ilSCGroup::getLastUpdate ( )

Get last update date.

Returns
ilDateTime

Definition at line 80 of file class.ilSCGroup.php.

References $last_update.

81  {
82  if (!$this->last_update) {
83  return $this->last_update = new ilDateTime();
84  }
85  return $this->last_update;
86  }
Date and time handling

◆ getStatus()

ilSCGroup::getStatus ( )

Get status.

Returns
int

Definition at line 97 of file class.ilSCGroup.php.

References $status.

Referenced by create().

98  {
99  return $this->status;
100  }
+ Here is the caller graph for this function:

◆ lookupComponent()

static ilSCGroup::lookupComponent (   $a_id)
static

lookup component by id type $ilDB

Parameters
type$a_id
Returns
string

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

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilSCComponentTaskFactory\getComponentTaskByForGroup().

38  {
39  global $ilDB;
40 
41  $query = 'SELECT component FROM sysc_groups ' .
42  'WHERE id = ' . $ilDB->quote($a_id, 'integer');
43  $res = $ilDB->query($query);
44  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
45  return (string) $row->component;
46  }
47  return '';
48  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilSCGroup::read ( )

Read group.

Definition at line 105 of file class.ilSCGroup.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setComponentId(), setLastUpdate(), setStatus(), and ilTimeZone\UTC.

Referenced by __construct().

106  {
107  global $ilDB;
108 
109  if (!$this->getId()) {
110  return false;
111  }
112 
113  $query = 'SELECT * FROM sysc_groups ' .
114  'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
115  $res = $ilDB->query($query);
116  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
117  $this->setComponentId($row->component);
118  $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, ilTimeZone::UTC));
119  $this->setStatus($row->status);
120  }
121  return true;
122  }
const IL_CAL_DATETIME
foreach($_POST as $key=> $value) $res
setLastUpdate(ilDateTime $a_update)
Date and time handling
$query
global $ilDB
setStatus($a_status)
setComponentId($a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComponentId()

ilSCGroup::setComponentId (   $a_comp)

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

Referenced by read().

57  {
58  $this->component_id = $a_comp;
59  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCGroup::setLastUpdate ( ilDateTime  $a_update)

Definition at line 71 of file class.ilSCGroup.php.

Referenced by read().

72  {
73  $this->last_update = $a_update;
74  }
+ Here is the caller graph for this function:

◆ setStatus()

ilSCGroup::setStatus (   $a_status)

Definition at line 88 of file class.ilSCGroup.php.

Referenced by read().

89  {
90  $this->status = $a_status;
91  }
+ Here is the caller graph for this function:

Field Documentation

◆ $component_id

ilSCGroup::$component_id = ''
private

Definition at line 15 of file class.ilSCGroup.php.

Referenced by getComponentId().

◆ $component_type

ilSCGroup::$component_type = ''
private

Definition at line 16 of file class.ilSCGroup.php.

◆ $id

ilSCGroup::$id = 0
private

Definition at line 14 of file class.ilSCGroup.php.

Referenced by getId().

◆ $last_update

ilSCGroup::$last_update = null
private

Definition at line 17 of file class.ilSCGroup.php.

Referenced by getLastUpdate().

◆ $status

ilSCGroup::$status = 0
private

Definition at line 18 of file class.ilSCGroup.php.

Referenced by getStatus().


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