ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
class.ilLogComponentLevels.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
6
7
8
16
class
ilLogComponentLevels
17
{
18
protected
static
?
ilLogComponentLevels
$instance
= null;
22
protected
array
$components
= array();
23
24
protected
ilDBInterface
$db
;
25
29
protected
function
__construct
()
30
{
31
global
$DIC
;
32
$this->db = $DIC->database();
33
$this->
read
();
34
}
35
36
public
static
function
getInstance
():
ilLogComponentLevels
37
{
38
if
(!self::$instance) {
39
self::$instance =
new
self
();
40
}
41
return
self::$instance;
42
}
43
47
public
static
function
updateFromXML
($a_component_id): 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
}
68
73
public
function
getLogComponents
(): array
74
{
75
return
$this->components
;
76
}
77
78
public
function
read
(): 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
}
88
}
$res
$res
Definition:
ltiservices.php:69
ilLogComponentLevels\$db
ilDBInterface $db
Definition:
class.ilLogComponentLevels.php:24
ilLogComponentLevels\$components
array $components
Definition:
class.ilLogComponentLevels.php:22
ilLogComponentLevels\__construct
__construct()
constructor
Definition:
class.ilLogComponentLevels.php:29
$DIC
global $DIC
Definition:
feed.php:28
ilLogComponentLevels\updateFromXML
static updateFromXML($a_component_id)
Definition:
class.ilLogComponentLevels.php:47
$ilDB
$ilDB
Definition:
storeScorm2004.php:26
ilLogComponentLevels
individual log levels for components
Definition:
class.ilLogComponentLevels.php:16
ilDBInterface
ilLogComponentLevel
individual log levels for components
Definition:
class.ilLogComponentLevel.php:13
$query
$query
Definition:
proxy_ylocal.php:13
ilLogComponentLevels\getInstance
static getInstance()
Definition:
class.ilLogComponentLevels.php:36
ilLogComponentLevels\read
read()
Definition:
class.ilLogComponentLevels.php:78
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:29
ilLogComponentLevels\getLogComponents
getLogComponents()
Get component levels.
Definition:
class.ilLogComponentLevels.php:73
ilLogComponentLevels\$instance
static ilLogComponentLevels $instance
Definition:
class.ilLogComponentLevels.php:18
Services
Logging
classes
class.ilLogComponentLevels.php
Generated on Sun Aug 31 2025 22:02:22 for ILIAS by
1.8.13 (using
Doxyfile
)