ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSCGroups Class Reference

Description of class. More...

+ Collaboration diagram for ilSCGroups:

Public Member Functions

 updateFromComponentDefinition (string $a_component_id)
 
 lookupGroupByComponentId (string $a_component_id)
 
 getGroups ()
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 read ()
 

Protected Attributes

ilDBInterface $db
 

Private Member Functions

 __construct ()
 

Private Attributes

array $groups = array()
 

Static Private Attributes

static ilSCGroups $instance = null
 

Detailed Description

Description of class.

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.ilSCGroups.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCGroups::__construct ( )
private

Definition at line 32 of file class.ilSCGroups.php.

References $DIC, and read().

33  {
34  global $DIC;
35 
36  $this->db = $DIC->database();
37  $this->read();
38  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getGroups()

ilSCGroups::getGroups ( )
Returns
ilSCGroup[]

Definition at line 74 of file class.ilSCGroups.php.

References $groups.

Referenced by updateFromComponentDefinition().

74  : array
75  {
76  return $this->groups;
77  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilSCGroups::getInstance ( )
static

Definition at line 40 of file class.ilSCGroups.php.

Referenced by ilSystemCheckDefinitionProcessor\beginTag(), and ilSCGroupTableGUI\parse().

40  : ilSCGroups
41  {
42  return self::$instance ?? (self::$instance = new self());
43  }
Description of class.
+ Here is the caller graph for this function:

◆ lookupGroupByComponentId()

ilSCGroups::lookupGroupByComponentId ( string  $a_component_id)

Definition at line 60 of file class.ilSCGroups.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_TEXT.

60  : int
61  {
62  $query = 'SELECT id FROM sysc_groups ' .
63  'WHERE component = ' . $this->db->quote($a_component_id, ilDBConstants::T_TEXT);
64  $res = $this->db->query($query);
65  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
66  return (int) $row->id;
67  }
68  return 0;
69  }
$res
Definition: ltiservices.php:66

◆ read()

ilSCGroups::read ( )
protected

Definition at line 79 of file class.ilSCGroups.php.

References $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

79  : void
80  {
81  $query = 'SELECT id FROM sysc_groups ' .
82  'ORDER BY id ';
83  $res = $this->db->query($query);
84 
85  $this->groups = array();
86  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
87  $this->groups[] = new ilSCGroup((int) $row->id);
88  }
89  }
$res
Definition: ltiservices.php:66
Defines a system check group including different tasks of a component.
+ Here is the caller graph for this function:

◆ updateFromComponentDefinition()

ilSCGroups::updateFromComponentDefinition ( string  $a_component_id)

Definition at line 45 of file class.ilSCGroups.php.

References getGroups().

45  : int
46  {
47  foreach ($this->getGroups() as $group) {
48  if ($group->getComponentId() === $a_component_id) {
49  return $group->getId();
50  }
51  }
52 
53  $component_group = new ilSCGroup();
54  $component_group->setComponentId($a_component_id);
55  $component_group->create();
56 
57  return $component_group->getId();
58  }
Defines a system check group including different tasks of a component.
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilSCGroups::$db
protected

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

◆ $groups

array ilSCGroups::$groups = array()
private

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

Referenced by getGroups().

◆ $instance

ilSCGroups ilSCGroups::$instance = null
staticprivate

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


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