ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $ilDB, $query, getComponentId(), getId(), and getStatus().

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

◆ getComponentId()

ilSCGroup::getComponentId ( )

Get component.

Returns
string

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

References $component_id.

Referenced by create().

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

◆ getId()

ilSCGroup::getId ( )

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

References $id.

Referenced by create(), and read().

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

◆ getLastUpdate()

ilSCGroup::getLastUpdate ( )

Get last update date.

Returns
ilDateTime

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

References $last_update.

82  {
83  if(!$this->last_update)
84  {
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 $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  {
46  return (string) $row->component;
47  }
48  return '';
49  }
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 $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setComponentId(), setLastUpdate(), and setStatus().

Referenced by __construct().

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

Referenced by read().

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

◆ setLastUpdate()

ilSCGroup::setLastUpdate ( ilDateTime  $a_update)

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

Referenced by read().

73  {
74  $this->last_update = $a_update;
75  }
+ 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: