ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLogComponentLevel Class Reference

individual log levels for components More...

+ Collaboration diagram for ilLogComponentLevel:

Public Member Functions

 __construct (string $a_component_id, ?int $a_level=null)
 
 getComponentId ()
 
 setLevel (?int $a_level)
 
 getLevel ()
 
 update ()
 
 read ()
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

string $compontent_id = ''
 
int $component_level = 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 27 of file class.ilLogComponentLevel.php.

Constructor & Destructor Documentation

◆ __construct()

ilLogComponentLevel::__construct ( string  $a_component_id,
?int  $a_level = null 
)

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

References $DIC, null, read(), and setLevel().

35  {
36  global $DIC;
37 
38  $this->db = $DIC->database();
39  $this->compontent_id = $a_component_id;
40  if ($a_level === null) {
41  $this->read();
42  } else {
43  $this->setLevel($a_level);
44  }
45  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getComponentId()

ilLogComponentLevel::getComponentId ( )

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

References $compontent_id.

Referenced by read(), and update().

47  : string
48  {
49  return $this->compontent_id;
50  }
+ Here is the caller graph for this function:

◆ getLevel()

ilLogComponentLevel::getLevel ( )

Definition at line 57 of file class.ilLogComponentLevel.php.

References $component_level.

Referenced by update().

57  : ?int
58  {
60  }
+ Here is the caller graph for this function:

◆ read()

ilLogComponentLevel::read ( )

Definition at line 71 of file class.ilLogComponentLevel.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, getComponentId(), and ILIAS\Repository\int().

Referenced by __construct().

71  : void
72  {
73  $query = 'SELECT * FROM log_components ' .
74  'WHERE component_id = ' . $this->db->quote($this->getComponentId(), 'text');
75 
76  $res = $this->db->query($query);
77  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
78  $this->component_level = (int) $row->log_level;
79  }
80  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLevel()

ilLogComponentLevel::setLevel ( ?int  $a_level)

Definition at line 52 of file class.ilLogComponentLevel.php.

Referenced by __construct().

52  : void
53  {
54  $this->component_level = $a_level;
55  }
+ Here is the caller graph for this function:

◆ update()

ilLogComponentLevel::update ( )

Definition at line 62 of file class.ilLogComponentLevel.php.

References getComponentId(), and getLevel().

62  : void
63  {
64  $this->db->replace(
65  'log_components',
66  array('component_id' => array('text',$this->getComponentId())),
67  array('log_level' => array('integer',$this->getLevel()))
68  );
69  }
+ Here is the call graph for this function:

Field Documentation

◆ $component_level

int ilLogComponentLevel::$component_level = null
private

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

Referenced by getLevel().

◆ $compontent_id

string ilLogComponentLevel::$compontent_id = ''
private

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

Referenced by getComponentId().

◆ $db

ilDBInterface ilLogComponentLevel::$db
protected

Definition at line 32 of file class.ilLogComponentLevel.php.


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