ILIAS
trunk Revision v11.0_alpha-1702-gfd3ecb7f852
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
SettingsDBRepository.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Blog\Settings
;
22
23
use
ilDBInterface
;
24
use
ILIAS\Blog\InternalDataService
;
25
26
class
SettingsDBRepository
27
{
28
public
function
__construct
(
29
protected
ilDBInterface
$db
,
30
protected
InternalDataService
$data
31
) {
32
}
33
34
protected
function
getSettingsFromRecord
(array $rec):
Settings
35
{
36
$order = explode(
';'
, $rec[
'nav_order'
] ??
""
);
37
if
(count($order) === 1 && current($order) ===
""
) {
38
$order = [];
39
}
40
return
$this->data->settings(
41
(
int
) $rec[
'id'
],
42
(
bool
) $rec[
'ppic'
],
43
(
string
) $rec[
'bg_color'
],
44
(
string
) $rec[
'font_color'
],
45
(
bool
) $rec[
'rss_active'
],
46
(
bool
) $rec[
'approval'
],
47
(
bool
) $rec[
'abs_shorten'
],
48
(
int
) $rec[
'abs_shorten_len'
],
49
(
bool
) $rec[
'abs_image'
],
50
(
int
) $rec[
'abs_img_width'
],
51
(
int
) $rec[
'abs_img_height'
],
52
(
bool
) $rec[
'keywords'
],
53
(
bool
) $rec[
'authors'
],
54
(
int
) $rec[
'nav_mode'
],
55
(
int
) $rec[
'nav_list_mon_with_post'
],
56
(
int
) $rec[
'nav_list_mon'
],
57
(
int
) $rec[
'ov_post'
],
58
$order
59
);
60
}
61
62
public
function
create
(
Settings
$setting
): void
63
{
64
$this->db->insert(
"il_blog"
, [
65
"id"
=> [
"integer"
, $setting->
getId
()],
66
"ppic"
=> [
"integer"
, $setting->
getProfilePicture
()],
67
"bg_color"
=> [
"text"
, $setting->
getBackgroundColor
()],
68
"font_color"
=> [
"text"
, $setting->
getFontColor
()],
69
"rss_active"
=> [
"integer"
, $setting->
getRSS
()],
70
"approval"
=> [
"integer"
, $setting->
getApproval
()],
71
"abs_shorten"
=> [
"integer"
, $setting->
getAbstractShorten
()],
72
"abs_shorten_len"
=> [
"integer"
, $setting->
getAbstractShortenLength
()],
73
"abs_image"
=> [
"integer"
, $setting->
getAbstractImage
()],
74
"abs_img_width"
=> [
"integer"
, $setting->
getAbstractImageWidth
()],
75
"abs_img_height"
=> [
"integer"
, $setting->
getAbstractImageHeight
()],
76
"keywords"
=> [
"integer"
, $setting->
getKeywords
()],
77
"authors"
=> [
"integer"
, $setting->
getAuthors
()],
78
"nav_mode"
=> [
"integer"
, $setting->
getNavMode
()],
79
"nav_list_mon_with_post"
=> [
"integer"
, $setting->
getNavModeListMonthsWithPostings
()],
80
"nav_list_mon"
=> [
"integer"
, $setting->
getNavModeListMonths
()],
81
"ov_post"
=> [
"integer"
, $setting->
getOverviewPostings
()],
82
"nav_order"
=> [
"text"
, implode(
';'
, $setting->
getOrder
())]
83
]);
84
}
85
86
public
function
update
(
Settings
$setting
): void
87
{
88
$this->db->update(
"il_blog"
, [
89
"ppic"
=> [
"integer"
, $setting->
getProfilePicture
()],
90
"bg_color"
=> [
"text"
, $setting->
getBackgroundColor
()],
91
"font_color"
=> [
"text"
, $setting->
getFontColor
()],
92
"rss_active"
=> [
"integer"
, $setting->
getRSS
()],
93
"approval"
=> [
"integer"
, $setting->
getApproval
()],
94
"abs_shorten"
=> [
"integer"
, $setting->
getAbstractShorten
()],
95
"abs_shorten_len"
=> [
"integer"
, $setting->
getAbstractShortenLength
()],
96
"abs_image"
=> [
"integer"
, $setting->
getAbstractImage
()],
97
"abs_img_width"
=> [
"integer"
, $setting->
getAbstractImageWidth
()],
98
"abs_img_height"
=> [
"integer"
, $setting->
getAbstractImageHeight
()],
99
"keywords"
=> [
"integer"
, $setting->
getKeywords
()],
100
"authors"
=> [
"integer"
, $setting->
getAuthors
()],
101
"nav_mode"
=> [
"integer"
, $setting->
getNavMode
()],
102
"nav_list_mon_with_post"
=> [
"integer"
, $setting->
getNavModeListMonthsWithPostings
()],
103
"nav_list_mon"
=> [
"integer"
, $setting->
getNavModeListMonths
()],
104
"ov_post"
=> [
"integer"
, $setting->
getOverviewPostings
()],
105
"nav_order"
=> [
"text"
, implode(
';'
, $setting->
getOrder
())]
106
], [
107
"id"
=> [
"integer"
, $setting->
getId
() ?? 0]
108
]);
109
}
110
111
public
function
getByObjId
(
int
$id
): ?
Settings
112
{
113
$set = $this->db->queryF(
114
"SELECT * FROM il_blog WHERE id = %s"
,
115
[
"integer"
],
116
[$id]
117
);
118
119
$rec = $this->db->fetchAssoc($set);
120
if
($rec !==
false
) {
121
return
$this->
getSettingsFromRecord
($rec);
122
}
123
return
null
;
124
}
125
126
public
function
saveOrder
(
int
$id
, array $order): void
127
{
128
$this->db->update(
129
"il_blog"
,
130
[
131
"nav_order"
=> [
""
, implode(
';'
, $order)]
132
],
133
[
134
"id"
=> [
"integer"
, $id]
135
]
136
);
137
}
138
139
}
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getOrder
getOrder()
Definition:
Settings.php:139
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository
Definition:
SettingsDBRepository.php:26
InternalDataService
$data
$data
Definition:
ltiregistration.php:29
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\update
update(Settings $setting)
Definition:
SettingsDBRepository.php:86
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getFontColor
getFontColor()
Definition:
Settings.php:69
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\create
create(Settings $setting)
Definition:
SettingsDBRepository.php:62
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAbstractShortenLength
getAbstractShortenLength()
Definition:
Settings.php:89
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getOverviewPostings
getOverviewPostings()
Definition:
Settings.php:134
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\getByObjId
getByObjId(int $id)
Definition:
SettingsDBRepository.php:111
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getNavModeListMonths
getNavModeListMonths()
Definition:
Settings.php:129
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getKeywords
getKeywords()
Definition:
Settings.php:109
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getNavMode
getNavMode()
Definition:
Settings.php:119
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:142
ILIAS\$setting
ilSetting $setting
Definition:
class.ilias.php:68
ILIAS\Blog\Settings
Definition:
class.BlockSettingsGUI.php:21
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getProfilePicture
getProfilePicture()
Definition:
Settings.php:59
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAbstractImageHeight
getAbstractImageHeight()
Definition:
Settings.php:104
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAbstractShorten
getAbstractShorten()
Definition:
Settings.php:84
ilDBInterface
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAbstractImageWidth
getAbstractImageWidth()
Definition:
Settings.php:99
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAbstractImage
getAbstractImage()
Definition:
Settings.php:94
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getNavModeListMonthsWithPostings
getNavModeListMonthsWithPostings()
Definition:
Settings.php:124
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\__construct
__construct(protected ilDBInterface $db, protected InternalDataService $data)
Definition:
SettingsDBRepository.php:28
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getAuthors
getAuthors()
Definition:
Settings.php:114
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\saveOrder
saveOrder(int $id, array $order)
Definition:
SettingsDBRepository.php:126
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getBackgroundColor
getBackgroundColor()
Definition:
Settings.php:64
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
SettingsInterface
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\getSettingsFromRecord
getSettingsFromRecord(array $rec)
Definition:
SettingsDBRepository.php:34
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getRSS
getRSS()
Definition:
Settings.php:74
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getApproval
getApproval()
Definition:
Settings.php:79
ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getId
getId()
Definition:
Settings.php:47
ILIAS\$db
$db
Definition:
class.ilias.php:60
components
ILIAS
Blog
Settings
SettingsDBRepository.php
Generated on Thu Apr 3 2025 23:02:26 for ILIAS by
1.8.13 (using
Doxyfile
)