ILIAS  release_8 Revision v8.23
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 16 of file class.ilLogComponentLevels.php.

Constructor & Destructor Documentation

◆ __construct()

ilLogComponentLevels::__construct ( )
protected

constructor

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

References $DIC, and read().

30  {
31  global $DIC;
32  $this->db = $DIC->database();
33  $this->read();
34  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstance()

static ilLogComponentLevels::getInstance ( )
static

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

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

37  {
38  if (!self::$instance) {
39  self::$instance = new self();
40  }
41  return self::$instance;
42  }
individual log levels for components
+ Here is the caller graph for this function:

◆ getLogComponents()

ilLogComponentLevels::getLogComponents ( )

Get component levels.

Returns
ilLogComponentLevel[]

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

References $components.

73  : array
74  {
75  return $this->components;
76  }

◆ read()

ilLogComponentLevels::read ( )

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

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

Referenced by __construct().

78  : void
79  {
80  $query = 'SELECT * FROM log_components ';
81  $res = $this->db->query($query);
82 
83  $this->components = array();
84  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
85  $this->components[] = new ilLogComponentLevel((string) $row->component_id, (int) $row->log_level);
86  }
87  }
$res
Definition: ltiservices.php:69
individual log levels for components
$query
+ Here is the caller graph for this function:

◆ updateFromXML()

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

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilLoggingDefinitionProcessor\beginTag().

47  : bool
48  {
49  global $DIC;
50 
51  $ilDB = $DIC->database();
52  if (!$a_component_id) {
53  return false;
54  }
55 
56  $query = 'SELECT * FROM log_components ' .
57  'WHERE component_id = ' . $ilDB->quote($a_component_id, 'text');
58  $res = $ilDB->query($query);
59  if (!$res->numRows()) {
60  $query = 'INSERT INTO log_components (component_id) ' .
61  'VALUES (' .
62  $ilDB->quote($a_component_id, 'text') .
63  ')';
64  $ilDB->manipulate($query);
65  }
66  return true;
67  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

Field Documentation

◆ $components

array ilLogComponentLevels::$components = array()
protected

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

Referenced by getLogComponents().

◆ $db

ilDBInterface ilLogComponentLevels::$db
protected

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

◆ $instance

ilLogComponentLevels ilLogComponentLevels::$instance = null
staticprotected

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


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