ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 131 of file class.ilSCGroup.php.

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

132  {
133  global $DIC;
134 
135  $ilDB = $DIC['ilDB'];
136 
137  $this->id = $ilDB->nextId('sysc_groups');
138 
139  $query = 'INSERT INTO sysc_groups (id,component,status) ' .
140  'VALUES ( ' .
141  $ilDB->quote($this->getId(), 'integer') . ', ' .
142  $ilDB->quote($this->getComponentId(), 'text') . ', ' .
143  $ilDB->quote($this->getStatus(), 'integer') . ' ' .
144  ')';
145  $ilDB->manipulate($query);
146  return $this->getId();
147  }
getComponentId()
Get component.
global $DIC
Definition: saml.php:7
getStatus()
Get status.
$query
global $ilDB
+ Here is the call graph for this function:

◆ getComponentId()

ilSCGroup::getComponentId ( )

Get component.

Returns
string

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

References $component_id.

Referenced by create().

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

◆ getId()

ilSCGroup::getId ( )

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

References $id.

Referenced by create(), and read().

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

◆ getLastUpdate()

ilSCGroup::getLastUpdate ( )

Get last update date.

Returns
ilDateTime

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

References $last_update.

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

◆ getStatus()

ilSCGroup::getStatus ( )

Get status.

Returns
int

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

References $status.

Referenced by create().

100  {
101  return $this->status;
102  }
+ 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 $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilSCComponentTaskFactory\getComponentTaskGUIForGroup(), and ilSCComponentTaskFactory\getTask().

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

◆ read()

ilSCGroup::read ( )

Read group.

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

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

Referenced by __construct().

108  {
109  global $DIC;
110 
111  $ilDB = $DIC['ilDB'];
112 
113  if (!$this->getId()) {
114  return false;
115  }
116 
117  $query = 'SELECT * FROM sysc_groups ' .
118  'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
119  $res = $ilDB->query($query);
120  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
121  $this->setComponentId($row->component);
122  $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, ilTimeZone::UTC));
123  $this->setStatus($row->status);
124  }
125  return true;
126  }
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setLastUpdate(ilDateTime $a_update)
Date and time handling
$query
$row
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 58 of file class.ilSCGroup.php.

Referenced by read().

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

◆ setLastUpdate()

ilSCGroup::setLastUpdate ( ilDateTime  $a_update)

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

Referenced by read().

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

◆ setStatus()

ilSCGroup::setStatus (   $a_status)

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

Referenced by read().

91  {
92  $this->status = $a_status;
93  }
+ 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: