19 declare(strict_types=1);
37 $rows = $this->db_wrapper->query(
38 'SELECT * FROM il_md_cpr_selections WHERE entry_id = ' .
39 $this->db_wrapper->quoteInteger($id)
42 foreach ($rows as $row) {
50 $rows = $this->db_wrapper->query(
51 'SELECT * FROM il_md_cpr_selections 52 ORDER BY is_default DESC, position ASC' 55 foreach ($rows as $row) {
62 $rows = $this->db_wrapper->query(
63 'SELECT * FROM il_md_cpr_selections WHERE outdated = 0 64 ORDER BY is_default DESC, position ASC' 67 foreach ($rows as $row) {
74 $rows = $this->db_wrapper->query(
75 'SELECT * FROM il_md_cpr_selections WHERE is_default = 1' 78 foreach ($rows as $row) {
87 (
string) ($row[
'full_name'] ??
''),
88 !empty($row[
'link'] ??
'') ? $this->
getURI((
string) $row[
'link']) :
null,
89 !empty($row[
'image_link']) ? $this->
getURI((
string) $row[
'image_link']) : null,
90 (
string) ($row[
'image_file'] ??
''),
91 (
string) ($row[
'alt_text'] ??
''),
92 $row[
'is_default'] ?
true :
false 96 (
int) $row[
'entry_id'],
97 (
string) ($row[
'title'] ??
''),
98 (
string) ($row[
'description'] ??
''),
99 $row[
'is_default'] ?
true :
false,
100 $row[
'outdated'] ?
true :
false,
101 (
int) ($row[
'position'] ?? 0),
108 return new URI($uri);
113 $this->db_wrapper->manipulate(
114 'DELETE FROM il_md_cpr_selections WHERE entry_id = ' .
115 $this->db_wrapper->quoteInteger($id)
121 string $description =
'',
122 bool $is_outdated =
false,
123 string $full_name =
'',
125 URI|
string $image =
'',
126 string $alt_text =
'' 130 $next_id = $this->db_wrapper->nextId(
'il_md_cpr_selections');
131 if (is_string($image)) {
133 $image_file = $image;
135 $image_link = (string) $image;
139 $this->db_wrapper->insert(
140 'il_md_cpr_selections',
162 $rows = $this->db_wrapper->query(
163 'SELECT MAX(position) AS max FROM il_md_cpr_selections WHERE is_default = 0' 165 foreach ($rows as $row) {
166 return isset($row[
'max']) ? ((
int) $row[
'max']) + 1 : 0;
174 string $description =
'',
175 bool $is_outdated =
false,
176 string $full_name =
'',
178 URI|
string $image =
'',
179 string $alt_text =
'' 183 if (is_string($image)) {
185 $image_file = $image;
187 $image_link = (string) $image;
191 $this->db_wrapper->update(
192 'il_md_cpr_selections',
212 throw new \ilMDCopyrightException(
213 'Copyright entries can not have an empty title' 222 foreach ($ids as
$id) {
223 if ($id === $default_id) {
233 $rows = $this->db_wrapper->query(
234 'SELECT entry_id FROM il_md_cpr_selections WHERE is_default = 1' 237 foreach ($rows as $row) {
238 return (
int) ($row[
'entry_id'] ?? 0);
245 $this->db_wrapper->update(
246 'il_md_cpr_selections',
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins