ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 13 of file class.ilLogComponentLevel.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

21  {
22  global $DIC;
23 
24  $this->db = $DIC->database();
25  $this->compontent_id = $a_component_id;
26  if ($a_level === null) {
27  $this->read();
28  } else {
29  $this->setLevel($a_level);
30  }
31  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getComponentId()

ilLogComponentLevel::getComponentId ( )

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

References $compontent_id.

Referenced by read(), and update().

33  : string
34  {
35  return $this->compontent_id;
36  }
+ Here is the caller graph for this function:

◆ getLevel()

ilLogComponentLevel::getLevel ( )

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

References $component_level.

Referenced by update().

43  : ?int
44  {
46  }
+ Here is the caller graph for this function:

◆ read()

ilLogComponentLevel::read ( )

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

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

Referenced by __construct().

57  : void
58  {
59  $query = 'SELECT * FROM log_components ' .
60  'WHERE component_id = ' . $this->db->quote($this->getComponentId(), 'text');
61 
62  $res = $this->db->query($query);
63  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
64  $this->component_level = (int) $row->log_level;
65  }
66  }
$res
Definition: ltiservices.php:69
$query
+ 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 38 of file class.ilLogComponentLevel.php.

Referenced by __construct().

38  : void
39  {
40  $this->component_level = $a_level;
41  }
+ Here is the caller graph for this function:

◆ update()

ilLogComponentLevel::update ( )

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

References getComponentId(), and getLevel().

48  : void
49  {
50  $this->db->replace(
51  'log_components',
52  array('component_id' => array('text',$this->getComponentId())),
53  array('log_level' => array('integer',$this->getLevel()))
54  );
55  }
+ Here is the call graph for this function:

Field Documentation

◆ $component_level

int ilLogComponentLevel::$component_level = null
private

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

Referenced by getLevel().

◆ $compontent_id

string ilLogComponentLevel::$compontent_id = ''
private

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

Referenced by getComponentId().

◆ $db

ilDBInterface ilLogComponentLevel::$db
protected

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


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