ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 86 of file class.ilSCGroups.php.

87 {
88 return (array) $this->groups;
89 }

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 {
38 return self::$instance = new self();
39 }
40 return self::$instance;
41 }

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 67 of file class.ilSCGroups.php.

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(DB_FETCHMODE_OBJECT))
75 {
76 return $row->id;
77 }
78 return 0;
79 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjDefReader\handlerBeginTag().

+ Here is the caller graph for this function:

◆ read()

ilSCGroups::read ( )
protected

read groups

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

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(DB_FETCHMODE_OBJECT))
104 {
105 $this->groups[] = new ilSCGroup($row->id);
106 }
107 }
Defines a system check group including different tasks of a component.

References $ilDB, $query, $res, $row, and DB_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 47 of file class.ilSCGroups.php.

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.

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: