ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilECSServerSettings Class Reference

Collection of ECS settings. More...

+ Collaboration diagram for ilECSServerSettings:

Public Member Functions

 activeServerExists ()
 Check if there is any active server. More...
 
 serverExists ()
 Check if there is any server. More...
 
 getServers ()
 Get servers. More...
 
 readInactiveServers ()
 Read inactive servers @global ilDB $ilDB. More...
 

Static Public Member Functions

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

Protected Member Functions

 __construct ()
 Singleton contructor. More...
 

Private Member Functions

 readActiveServers ()
 Read all actice servers @global ilDB $ilDB. More...
 

Private Attributes

 $servers = array()
 

Static Private Attributes

static $instance = null
 

Detailed Description

Collection of ECS settings.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilECSServerSettings::__construct ( )
protected

Singleton contructor.

Definition at line 44 of file class.ilECSServerSettings.php.

45 {
46 $this->readActiveServers();
47 }
readActiveServers()
Read all actice servers @global ilDB $ilDB.

References readActiveServers().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeServerExists()

ilECSServerSettings::activeServerExists ( )

Check if there is any active server.

Returns
bool

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

68 {
69 return count($this->getServers()) ? true : false;
70 }

References getServers().

+ Here is the call graph for this function:

◆ getInstance()

◆ getServers()

ilECSServerSettings::getServers ( )

Get servers.

Returns
array ilECSSetting

Definition at line 85 of file class.ilECSServerSettings.php.

86 {
87 return (array) $this->servers;
88 }

References $servers.

Referenced by activeServerExists(), ilECSServerTableGUI\parse(), and serverExists().

+ Here is the caller graph for this function:

◆ readActiveServers()

ilECSServerSettings::readActiveServers ( )
private

Read all actice servers @global ilDB $ilDB.

Definition at line 113 of file class.ilECSServerSettings.php.

114 {
115 global $ilDB;
116
117 $query = 'SELECT server_id FROM ecs_server '.
118 'WHERE active = '.$ilDB->quote(1,'integer').' '.
119 'ORDER BY title ';
120 $res = $ilDB->query($query);
121
122 $this->servers = array();
123 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
124 {
125 $this->servers[$row->server_id] = ilECSSetting::getInstanceByServerId($row->server_id);
126 }
127 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
global $ilDB

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilECSSetting\getInstanceByServerId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInactiveServers()

ilECSServerSettings::readInactiveServers ( )

Read inactive servers @global ilDB $ilDB.

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

95 {
96 global $ilDB;
97
98 $query = 'SELECT server_id FROM ecs_server '.
99 'WHERE active = '.$ilDB->quote(0,'integer').' '.
100 'ORDER BY title ';
101 $res = $ilDB->query($query);
102
103 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
104 {
105 $this->servers[$row->server_id] = ilECSSetting::getInstanceByServerId($row->server_id);
106 }
107 }

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilECSSetting\getInstanceByServerId().

+ Here is the call graph for this function:

◆ serverExists()

ilECSServerSettings::serverExists ( )

Check if there is any server.

Returns
bool

Definition at line 76 of file class.ilECSServerSettings.php.

77 {
78 return count($this->getServers()) ? true : false;
79 }

References getServers().

+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilECSServerSettings::$instance = null
staticprivate

Definition at line 36 of file class.ilECSServerSettings.php.

Referenced by getInstance().

◆ $servers

ilECSServerSettings::$servers = array()
private

Definition at line 38 of file class.ilECSServerSettings.php.

Referenced by getServers().


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