ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCGroups Class Reference

Description of class. More...

+ Collaboration diagram for ilSCGroups:

Public Member Functions

 updateFromComponentDefinition ($a_component_id)
 Update from component definition reader. More...
 
 lookupGroupByComponentId ($a_component_id)
 
 getGroups ()
 Get groups. More...
 

Static Public Member Functions

static getInstance ()
 Get singleton instance. More...
 

Protected Member Functions

 read ()
 read groups More...
 

Private Member Functions

 __construct ()
 Singleton constructor. More...
 

Private Attributes

 $groups = array()
 

Static Private Attributes

static $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 12 of file class.ilSCGroups.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCGroups::__construct ( )
private

Singleton constructor.

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

References read().

26  {
27  $this->read();
28  }
read()
read groups
+ Here is the call graph for this function:

Member Function Documentation

◆ getGroups()

ilSCGroups::getGroups ( )

Get groups.

Returns
ilSCGroup[]

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

References $groups, and array.

Referenced by updateFromComponentDefinition().

83  {
84  return (array) $this->groups;
85  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getInstance()

static ilSCGroups::getInstance ( )
static

Get singleton instance.

Returns
ilSCGroups

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

Referenced by ilObjDefReader\handlerBeginTag(), and ilSCGroupTableGUI\parse().

35  {
36  if (self::$instance == null) {
37  return self::$instance = new self();
38  }
39  return self::$instance;
40  }
+ Here is the caller graph for this function:

◆ lookupGroupByComponentId()

ilSCGroups::lookupGroupByComponentId (   $a_component_id)

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

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

65  {
66  global $ilDB;
67 
68  $query = 'SELECT id FROM sysc_groups ' .
69  'WHERE component = ' . $ilDB->quote($a_component_id, 'text');
70  $res = $ilDB->query($query);
71  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
72  return $row->id;
73  }
74  return 0;
75  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ read()

ilSCGroups::read ( )
protected

read groups

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

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

91  {
92  global $ilDB;
93 
94  $query = 'SELECT id FROM sysc_groups ' .
95  'ORDER BY id ';
96  $res = $ilDB->query($query);
97 
98  $this->groups = array();
99  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
100  $this->groups[] = new ilSCGroup($row->id);
101  }
102  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
Defines a system check group including different tasks of a component.
+ Here is the caller graph for this function:

◆ updateFromComponentDefinition()

ilSCGroups::updateFromComponentDefinition (   $a_component_id)

Update from component definition reader.

Parameters
type$a_component_id

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

References getGroups().

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

Field Documentation

◆ $groups

ilSCGroups::$groups = array()
private

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

Referenced by getGroups().

◆ $instance

ilSCGroups::$instance = null
staticprivate

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


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