ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 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 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.

References readActiveServers().

45  {
46  $this->readActiveServers();
47  }
readActiveServers()
Read all actice servers ilDB $ilDB.
+ 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 66 of file class.ilECSServerSettings.php.

References getServers().

67  {
68  return count($this->getServers()) ? true : false;
69  }
+ Here is the call graph for this function:

◆ getInstance()

◆ getServers()

ilECSServerSettings::getServers ( )

Get servers.

Returns
array ilECSSetting

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

References $servers.

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

85  {
86  return (array) $this->servers;
87  }
+ Here is the caller graph for this function:

◆ readActiveServers()

ilECSServerSettings::readActiveServers ( )
private

Read all actice servers ilDB $ilDB.

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

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilECSSetting\getInstanceByServerId().

Referenced by __construct().

114  {
115  global $DIC;
116 
117  $ilDB = $DIC['ilDB'];
118 
119  $query = 'SELECT server_id FROM ecs_server ' .
120  'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
121  'ORDER BY title ';
122  $res = $ilDB->query($query);
123 
124  $this->servers = array();
125  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
126  $this->servers[$row->server_id] = ilECSSetting::getInstanceByServerId($row->server_id);
127  }
128  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInactiveServers()

ilECSServerSettings::readInactiveServers ( )

Read inactive servers ilDB $ilDB.

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

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilECSSetting\getInstanceByServerId().

94  {
95  global $DIC;
96 
97  $ilDB = $DIC['ilDB'];
98 
99  $query = 'SELECT server_id FROM ecs_server ' .
100  'WHERE active = ' . $ilDB->quote(0, 'integer') . ' ' .
101  'ORDER BY title ';
102  $res = $ilDB->query($query);
103 
104  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
105  $this->servers[$row->server_id] = ilECSSetting::getInstanceByServerId($row->server_id);
106  }
107  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the call graph for this function:

◆ serverExists()

ilECSServerSettings::serverExists ( )

Check if there is any server.

Returns
bool

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

References getServers().

76  {
77  return count($this->getServers()) ? true : false;
78  }
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilECSServerSettings::$instance = null
staticprivate

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

◆ $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: