ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSCGroup Class Reference

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

+ Collaboration diagram for ilSCGroup:

Public Member Functions

 __construct (int $a_id=0)
 
 getId ()
 
 setComponentId (string $a_comp)
 
 getComponentId ()
 
 setLastUpdate (ilDateTime $a_update)
 
 getLastUpdate ()
 
 setStatus (int $a_status)
 
 getStatus ()
 
 read ()
 
 create ()
 

Static Public Member Functions

static lookupComponent (int $a_id)
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $id = 0
 
string $component_id = ''
 
string $component_type = ''
 
ilDateTime $last_update = null
 
int $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 24 of file class.ilSCGroup.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCGroup::__construct ( int  $a_id = 0)

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

34 {
35 global $DIC;
36 $this->db = $DIC->database();
37 $this->id = $a_id;
38 $this->read();
39 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilSCGroup::create ( )

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

111 : int
112 {
113 $this->id = $this->db->nextId('sysc_groups');
114
115 $query = 'INSERT INTO sysc_groups (id,component,status) ' .
116 'VALUES ( ' .
117 $this->db->quote($this->getId(), ilDBConstants::T_INTEGER) . ', ' .
118 $this->db->quote($this->getComponentId(), ilDBConstants::T_TEXT) . ', ' .
119 $this->db->quote($this->getStatus(), ilDBConstants::T_INTEGER) . ' ' .
120 ')';
121 $this->db->manipulate($query);
122 return $this->getId();
123 }

References getComponentId(), getId(), getStatus(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ getComponentId()

ilSCGroup::getComponentId ( )

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

66 : string
67 {
69 }
string $component_id

References $component_id.

Referenced by create().

+ Here is the caller graph for this function:

◆ getId()

ilSCGroup::getId ( )

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

56 : int
57 {
58 return $this->id;
59 }

References $id.

Referenced by create(), and read().

+ Here is the caller graph for this function:

◆ getLastUpdate()

ilSCGroup::getLastUpdate ( )

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

77 {
78 if (!$this->last_update) {
79 return $this->last_update = new ilDateTime();
80 }
81 return $this->last_update;
82 }
@classDescription Date and time handling
ilDateTime $last_update

References $last_update.

◆ getStatus()

ilSCGroup::getStatus ( )

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

89 : int
90 {
91 return $this->status;
92 }

References $status.

Referenced by create().

+ Here is the caller graph for this function:

◆ lookupComponent()

static ilSCGroup::lookupComponent ( int  $a_id)
static

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

41 : string
42 {
43 global $DIC;
44
45 $ilDB = $DIC->database();
46
47 $query = 'SELECT component FROM sysc_groups ' .
48 'WHERE id = ' . $ilDB->quote($a_id, ilDBConstants::T_INTEGER);
49 $res = $ilDB->query($query);
50 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
51 return (string) $row->component;
52 }
53 return '';
54 }
$res
Definition: ltiservices.php:69

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_INTEGER.

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

+ Here is the caller graph for this function:

◆ read()

ilSCGroup::read ( )

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

94 : bool
95 {
96 if (!$this->getId()) {
97 return false;
98 }
99
100 $query = 'SELECT * FROM sysc_groups ' .
101 'WHERE id = ' . $this->db->quote($this->getId(), ilDBConstants::T_INTEGER);
102 $res = $this->db->query($query);
103 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
104 $this->setComponentId((string) $row->component);
105 $this->setLastUpdate(new ilDateTime($row->last_update, IL_CAL_DATETIME, ilTimeZone::UTC));
106 $this->setStatus((int) $row->status);
107 }
108 return true;
109 }
const IL_CAL_DATETIME
setStatus(int $a_status)
setLastUpdate(ilDateTime $a_update)
setComponentId(string $a_comp)

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setComponentId()

ilSCGroup::setComponentId ( string  $a_comp)

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

61 : void
62 {
63 $this->component_id = $a_comp;
64 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilSCGroup::setLastUpdate ( ilDateTime  $a_update)

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

71 : void
72 {
73 $this->last_update = $a_update;
74 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setStatus()

ilSCGroup::setStatus ( int  $a_status)

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

84 : void
85 {
86 $this->status = $a_status;
87 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $component_id

string ilSCGroup::$component_id = ''
private

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

Referenced by getComponentId().

◆ $component_type

string ilSCGroup::$component_type = ''
private

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

◆ $db

ilDBInterface ilSCGroup::$db
protected

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

◆ $id

int ilSCGroup::$id = 0
private

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

Referenced by getId().

◆ $last_update

ilDateTime ilSCGroup::$last_update = null
private

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

Referenced by getLastUpdate().

◆ $status

int ilSCGroup::$status = 0
private

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

Referenced by getStatus().


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