ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 @global 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.

26 {
27 $this->id = $a_id;
28 $this->read();
29 }
read()
Read group.

References read().

+ 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.

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

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

+ Here is the call graph for this function:

◆ getComponentId()

ilSCGroup::getComponentId ( )

Get component.

Returns
string

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

67 {
69 }

References $component_id.

Referenced by create().

+ Here is the caller graph for this function:

◆ getId()

ilSCGroup::getId ( )

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

52 {
53 return $this->id;
54 }

References $id.

Referenced by create(), and read().

+ 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.

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

References $last_update.

◆ getStatus()

ilSCGroup::getStatus ( )

Get status.

Returns
int

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

100 {
101 return $this->status;
102 }

References $status.

Referenced by create().

+ Here is the caller graph for this function:

◆ lookupComponent()

static ilSCGroup::lookupComponent (   $a_id)
static

lookup component by id @global type $ilDB

Parameters
type$a_id
Returns
string

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

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(DB_FETCHMODE_OBJECT))
45 {
46 return (string) $row->component;
47 }
48 return '';
49 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilSCComponentTaskFactory\getComponentTaskByForGroup().

+ Here is the caller graph for this function:

◆ read()

ilSCGroup::read ( )

Read group.

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

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(DB_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
setStatus($a_status)
setComponentId($a_comp)
setLastUpdate(ilDateTime $a_update)

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getId(), IL_CAL_DATETIME, setComponentId(), setLastUpdate(), and setStatus().

Referenced by __construct().

+ 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.

58 {
59 $this->component_id = $a_comp;
60 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCGroup::setLastUpdate ( ilDateTime  $a_update)

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

73 {
74 $this->last_update = $a_update;
75 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStatus()

ilSCGroup::setStatus (   $a_status)

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

91 {
92 $this->status = $a_status;
93 }

Referenced by read().

+ 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: