ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getComponentId()

ilLogComponentLevel::getComponentId ( )

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

47 : string
48 {
50 }

References $compontent_id.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ getLevel()

ilLogComponentLevel::getLevel ( )

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

57 : ?int
58 {
60 }

References $component_level.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilLogComponentLevel::read ( )

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

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:69

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

Referenced by __construct().

+ 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.

52 : void
53 {
54 $this->component_level = $a_level;
55 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ update()

ilLogComponentLevel::update ( )

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

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 }

References getComponentId(), and getLevel().

+ 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: