ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.

26 {
27 $this->read();
28 }
read()
read groups

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ getGroups()

ilSCGroups::getGroups ( )

Get groups.

Returns
ilSCGroup[]

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

85 {
86 return (array) $this->groups;
87 }

References $groups.

Referenced by updateFromComponentDefinition().

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

35 {
36 if (self::$instance == null) {
37 return self::$instance = new self();
38 }
39 return self::$instance;
40 }

References $instance.

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

+ Here is the caller graph for this function:

◆ lookupGroupByComponentId()

ilSCGroups::lookupGroupByComponentId (   $a_component_id)

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

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

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

◆ read()

ilSCGroups::read ( )
protected

read groups

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

93 {
94 global $DIC;
95
96 $ilDB = $DIC['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 $this->groups[] = new ilSCGroup($row->id);
105 }
106 }
Defines a system check group including different tasks of a component.

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

Referenced by __construct().

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

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.

References getGroups().

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

Referenced by getInstance().


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