ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMMItemStorage.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
31{
32 public static function register(isItem $item): ilMMItemStorage
33 {
34 if ($item instanceof Lost) {
35 return new self();
36 }
37
38 $mm_item = ilMMItemStorage::find($item->getProviderIdentification()->serialize());
39 if ($mm_item === null) {
40 $mm_item = new ilMMItemStorage();
41 $mm_item->setPosition($item->getPosition());
42 $mm_item->setIdentification($item->getProviderIdentification()->serialize());
43 $mm_item->setActive(true);
44 if ($item instanceof isChild) {
45 $mm_item->setParentIdentification($item->getParent()->serialize());
46 }
47 $mm_item->create();
48 }
49
50 return $mm_item;
51 }
52
53
54
55
56 #[\Override]
57 public function create(): void
58 {
59 parent::create();
60 if (self::find($this->getIdentification()) !== null) {
61 $this->update();
62 } else {
63 }
64 }
65
66
74 protected ?string $identification = null;
80 protected bool $active = true;
86 protected int $position = 0;
92 protected ?string $parent_identification = '';
98 protected ?string $icon_id = '';
99 protected string $connector_container_name = "il_mm_items";
100
101
102 public function getIdentification(): string
103 {
105 }
106
107
108 public function setIdentification(string $identification): void
109 {
110 $this->identification = $identification;
111 }
112
113
114 public function isActive(): bool
115 {
116 return $this->active;
117 }
118
119
120 public function setActive(bool $active): void
121 {
122 $this->active = $active;
123 }
124
125
126 public function getPosition(): int
127 {
128 return $this->position;
129 }
130
131
132 public function setPosition(int $position): void
133 {
134 $this->position = $position;
135 }
136
137
138 public function getParentIdentification(): string
139 {
141 }
142
143
145 {
146 $this->parent_identification = $parent_identification;
147 }
148
149
153 public function getIconId(): ?string
154 {
155 return $this->icon_id === '' ? null : $this->icon_id;
156 }
157
158
159 public function setIconId(string $icon_id): ilMMItemStorage
160 {
161 $this->icon_id = $icon_id;
162
163 return $this;
164 }
165}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMMItemStorage.
setPosition(int $position)
string $parent_identification
@con_has_field true @con_fieldtype text @con_length 256
string $identification
@con_is_primary true @con_is_unique true @con_has_field true @con_fieldtype text @con_length 64
bool $active
@con_has_field true @con_fieldtype integer @con_length 1
setIconId(string $icon_id)
int $position
@con_has_field true @con_fieldtype integer @con_length 4
setParentIdentification(string $parent_identification)
string $icon_id
@con_has_field true @con_fieldtype text @con_length 256
setIdentification(string $identification)