ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 86 of file class.ilSCGroups.php.

References $groups, and array.

Referenced by updateFromComponentDefinition().

87  {
88  return (array) $this->groups;
89  }
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  {
38  return self::$instance = new self();
39  }
40  return self::$instance;
41  }
+ Here is the caller graph for this function:

◆ lookupGroupByComponentId()

ilSCGroups::lookupGroupByComponentId (   $a_component_id)

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

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

68  {
69  global $ilDB;
70 
71  $query = 'SELECT id FROM sysc_groups '.
72  'WHERE component = '.$ilDB->quote($a_component_id,'text');
73  $res = $ilDB->query($query);
74  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
75  {
76  return $row->id;
77  }
78  return 0;
79  }
global $ilDB

◆ read()

ilSCGroups::read ( )
protected

read groups

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

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

Referenced by __construct().

95  {
96  global $ilDB;
97 
98  $query = 'SELECT id FROM sysc_groups '.
99  'ORDER BY id ';
100  $res = $ilDB->query($query);
101 
102  $this->groups = array();
103  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
104  {
105  $this->groups[] = new ilSCGroup($row->id);
106  }
107  }
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 47 of file class.ilSCGroups.php.

References getGroups().

48  {
49  foreach($this->getGroups() as $group)
50  {
51  if($group->getComponentId() == $a_component_id)
52  {
53  return $group->getId();
54  }
55  }
56 
57  $component_group = new ilSCGroup();
58  $component_group->setComponentId($a_component_id);
59  $component_group->create();
60 
61  return $component_group->getId();
62  }
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: