19 declare(strict_types=1);
27 protected \ilDBInterface
$db;
36 $res = $this->db->query(
37 'SELECT * FROM il_md_cpr_selections WHERE entry_id = ' .
41 if ($row = $this->db->fetchAssoc(
$res)) {
49 $res = $this->db->query(
50 'SELECT * FROM il_md_cpr_selections 51 ORDER BY is_default DESC, position ASC' 54 while ($row = $this->db->fetchAssoc(
$res)) {
61 $res = $this->db->query(
62 'SELECT * FROM il_md_cpr_selections WHERE outdated = 0 63 ORDER BY is_default DESC, position ASC' 66 while ($row = $this->db->fetchAssoc(
$res)) {
73 $res = $this->db->query(
74 'SELECT * FROM il_md_cpr_selections WHERE is_default = 1' 77 if ($row = $this->db->fetchAssoc(
$res)) {
86 $row[
'full_name'] ??
'',
87 !empty($row[
'link'] ??
'') ? $this->
getURI($row[
'link']) : null,
88 !empty($row[
'image_link']) ? $this->
getURI($row[
'image_link']) : null,
89 $row[
'image_file'] ??
'',
90 $row[
'alt_text'] ??
'',
91 $row[
'is_default'] ?
true :
false 97 $row[
'description'] ??
'',
98 $row[
'is_default'] ?
true :
false,
99 $row[
'outdated'] ?
true :
false,
100 $row[
'position'] ?? 0,
107 return new URI($uri);
112 $this->db->manipulate(
113 'DELETE FROM il_md_cpr_selections WHERE entry_id = ' .
120 string $description =
'',
121 bool $is_outdated =
false,
122 string $full_name =
'',
124 URI|
string $image =
'',
125 string $alt_text =
'' 129 $next_id = $this->db->nextId(
'il_md_cpr_selections');
130 if (is_string($image)) {
132 $image_file = $image;
134 $image_link = (string) $image;
139 'il_md_cpr_selections',
161 $res = $this->db->query(
162 'SELECT MAX(position) AS max FROM il_md_cpr_selections WHERE is_default = 0' 164 $row = $this->db->fetchAssoc(
$res);
166 return isset($row[
'max']) ? $row[
'max'] + 1 : 0;
172 string $description =
'',
173 bool $is_outdated =
false,
174 string $full_name =
'',
176 URI|
string $image =
'',
177 string $alt_text =
'' 181 if (is_string($image)) {
183 $image_file = $image;
185 $image_link = (string) $image;
190 'il_md_cpr_selections',
210 throw new \ilMDCopyrightException(
211 'Copyright entries can not have an empty title' 220 foreach ($ids as
$id) {
221 if ($id === $default_id) {
231 $res = $this->db->query(
232 'SELECT entry_id FROM il_md_cpr_selections WHERE is_default = 1' 235 if ($row = $this->db->fetchAssoc(
$res)) {
236 return $row[
'entry_id'] ?? 0;
244 'il_md_cpr_selections',
The scope of this class is split ilias-conform URI's into components.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins