ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLogComponentLevel.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13 private $compontent_id = '';
14 private $component_level = null;
15
16 public function __construct($a_component_id)
17 {
18 $this->compontent_id = $a_component_id;
19 $this->read();
20 }
21
22 public function getComponentId()
23 {
25 }
26
27 public function setLevel($a_level)
28 {
29 $this->component_level = $a_level;
30 }
31
32 public function getLevel()
33 {
35 }
36
37 public function update()
38 {
39 global $ilDB;
40
41 ilLoggerFactory::getLogger('log')->debug('update called');
42
43 $ilDB->replace(
44 'log_components',
45 array('component_id' => array('text',$this->getComponentId())),
46 array('log_level' => array('integer',$this->getLevel()))
47 );
48 }
49
54 public function read()
55 {
56 global $ilDB;
57
58 $query = 'SELECT * FROM log_components '.
59 'WHERE component_id = '.$ilDB->quote($this->getComponentId(),'text');
60
61 $res = $ilDB->query($query);
62 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
63 {
64 $this->component_level = $row->log_level;
65 }
66
67 }
68}
69?>
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
individual log levels for components
read()
Read entry @global type $ilDB.
static getLogger($a_component_id)
Get component logger.
global $ilDB