ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLogComponentLevels Class Reference

individual log levels for components More...

+ Collaboration diagram for ilLogComponentLevels:

Public Member Functions

 getLogComponents ()
 Get component levels. More...
 
 read ()
 

Static Public Member Functions

static getInstance ()
 
static updateFromXML ($a_component_id)
 

Protected Member Functions

 __construct ()
 constructor More...
 

Protected Attributes

array $components = array()
 
ilDBInterface $db
 

Static Protected Attributes

static ilLogComponentLevels $instance = null
 

Detailed Description

individual log levels for components

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

Definition at line 28 of file class.ilLogComponentLevels.php.

Constructor & Destructor Documentation

◆ __construct()

ilLogComponentLevels::__construct ( )
protected

constructor

Definition at line 41 of file class.ilLogComponentLevels.php.

References $DIC, and read().

42  {
43  global $DIC;
44  $this->db = $DIC->database();
45  $this->read();
46  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstance()

static ilLogComponentLevels::getInstance ( )
static

Definition at line 48 of file class.ilLogComponentLevels.php.

Referenced by ilLoggingDBSettings\getLevelByComponent(), ilLogComponentTableGUI\parse(), and ilObjLoggingSettingsGUI\resetComponentLevels().

49  {
50  if (!self::$instance) {
51  self::$instance = new self();
52  }
53  return self::$instance;
54  }
individual log levels for components
+ Here is the caller graph for this function:

◆ getLogComponents()

ilLogComponentLevels::getLogComponents ( )

Get component levels.

Returns
ilLogComponentLevel[]

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

References $components.

85  : array
86  {
87  return $this->components;
88  }

◆ read()

ilLogComponentLevels::read ( )

Definition at line 90 of file class.ilLogComponentLevels.php.

References $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

90  : void
91  {
92  $query = 'SELECT * FROM log_components ';
93  $res = $this->db->query($query);
94 
95  $this->components = array();
96  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
97  $this->components[] = new ilLogComponentLevel((string) $row->component_id, (int) $row->log_level);
98  }
99  }
$res
Definition: ltiservices.php:66
individual log levels for components
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ updateFromXML()

static ilLogComponentLevels::updateFromXML (   $a_component_id)
static
Parameters
string$a_component_id

Definition at line 59 of file class.ilLogComponentLevels.php.

References $DIC, $ilDB, and $res.

Referenced by ilLoggingDefinitionProcessor\beginTag().

59  : bool
60  {
61  global $DIC;
62 
63  $ilDB = $DIC->database();
64  if (!$a_component_id) {
65  return false;
66  }
67 
68  $query = 'SELECT * FROM log_components ' .
69  'WHERE component_id = ' . $ilDB->quote($a_component_id, 'text');
70  $res = $ilDB->query($query);
71  if (!$res->numRows()) {
72  $query = 'INSERT INTO log_components (component_id) ' .
73  'VALUES (' .
74  $ilDB->quote($a_component_id, 'text') .
75  ')';
76  $ilDB->manipulate($query);
77  }
78  return true;
79  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

Field Documentation

◆ $components

array ilLogComponentLevels::$components = array()
protected

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

Referenced by getLogComponents().

◆ $db

ilDBInterface ilLogComponentLevels::$db
protected

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

◆ $instance

ilLogComponentLevels ilLogComponentLevels::$instance = null
staticprotected

Definition at line 30 of file class.ilLogComponentLevels.php.


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