Class ilMMItemRepository.
More...
◆ __construct()
ilMMItemRepository::__construct |
( |
| ) |
|
ilMMItemRepository constructor.
- Exceptions
-
Definition at line 46 of file class.ilMMItemRepository.php.
47 {
50 $this->main_collector =
$DIC->globalScreen()->collector()->mainmenu();
51 $this->services =
$DIC->globalScreen();
52
53 foreach ($this->main_collector->getStackedTopItemsForPresentation() as $top_item) {
56 foreach ($top_item->getChildren() as $child) {
58 }
59 }
60 }
62 }
static register(isItem $item)
References $DIC, ilMMItemStorage\register(), and sync().
◆ clearCache()
ilMMItemRepository::clearCache |
( |
| ) |
|
◆ createItem()
◆ deleteItem()
◆ flushLostItems()
ilMMItemRepository::flushLostItems |
( |
| ) |
|
Definition at line 166 of file class.ilMMItemRepository.php.
167 {
169 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
170 if (Lost::class === $item_facade->getType()) {
171 $item_facade->delete();
172 }
173 }
174
176 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
177 if (Lost::class === $item_facade->getType()) {
178 $item_facade->delete();
179 }
180 }
181 }
getItemFacade(IdentificationInterface $identification=null)
References getItemFacade(), getSubItemsForTable(), and getTopItems().
◆ getEmptyItemForTypeString()
ilMMItemRepository::getEmptyItemForTypeString |
( |
string |
$class_name | ) |
|
◆ getItemFacade()
◆ getItemFacadeForIdentificationString()
ilMMItemRepository::getItemFacadeForIdentificationString |
( |
string |
$identification | ) |
|
◆ getPossibleParentsForFormAndTable()
ilMMItemRepository::getPossibleParentsForFormAndTable |
( |
| ) |
|
Definition at line 235 of file class.ilMMItemRepository.php.
235 : array
236 {
237 static $parents;
238 if (is_null($parents)) {
239 $parents = [];
241 $identification = $this->services->identification()->fromSerializedIdentification($top_item_identification);
244 $parents[$top_item_identification] = $this->
getItemFacade($identification)
245 ->getDefaultTitle();
246 }
247 }
248 }
249
250 return $parents;
251 }
getSingleItem(IdentificationInterface $identification)
References $data, getItemFacade(), getSingleItem(), and getTopItems().
◆ getPossibleSubItemTypesForForm()
ilMMItemRepository::getPossibleSubItemTypesForForm |
( |
| ) |
|
- Returns
- array
- See also
- getPossibleSubItemTypesWithInformation
- Deprecated:
Definition at line 260 of file class.ilMMItemRepository.php.
260 : array
261 {
262 $types = [];
263 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
264 if ($information->isCreationPrevented()) {
265 continue;
266 }
267 if ($information->isChild()) {
268 $types[$information->getType()] = $information->getTypeNameForPresentation();
269 }
270 }
271
272 return $types;
273 }
◆ getPossibleSubItemTypesWithInformation()
ilMMItemRepository::getPossibleSubItemTypesWithInformation |
( |
| ) |
|
- Returns
- \ILIAS\GlobalScreen\Scope\MainMenu\Collector\Information\TypeInformation[]
Definition at line 279 of file class.ilMMItemRepository.php.
279 : array
280 {
281 $types = [];
282 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
283 if ($information->isCreationPrevented()) {
284 continue;
285 }
286 if ($information->isChild()) {
287 $types[$information->getType()] = $information;
288 }
289 }
290
291 return $types;
292 }
◆ getPossibleTopItemTypesForForm()
ilMMItemRepository::getPossibleTopItemTypesForForm |
( |
| ) |
|
- Returns
- array
- See also
- getPossibleTopItemTypesWithInformation
- Deprecated:
Definition at line 300 of file class.ilMMItemRepository.php.
300 : array
301 {
302 $types = [];
303 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
304 if ($information->isTop()) {
305 $types[$information->getType()] = $information->getTypeNameForPresentation();
306 }
307 }
308
309 return $types;
310 }
◆ getPossibleTopItemTypesWithInformation()
ilMMItemRepository::getPossibleTopItemTypesWithInformation |
( |
| ) |
|
- Returns
- \ILIAS\GlobalScreen\Scope\MainMenu\Collector\Information\TypeInformation[]
Definition at line 316 of file class.ilMMItemRepository.php.
316 : array
317 {
318 $types = [];
319 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
320 if ($information->isTop()) {
321 $types[$information->getType()] = $information;
322 }
323 }
324
325 return $types;
326 }
◆ getSingleItem()
◆ getStackedTopItemsForPresentation()
ilMMItemRepository::getStackedTopItemsForPresentation |
( |
| ) |
|
- Returns
- TopLinkItem[]|TopParentItem[]
- Exceptions
-
Definition at line 108 of file class.ilMMItemRepository.php.
108 : array
109 {
110 $top_items = $this->main_collector->getStackedTopItemsForPresentation();
111
112 return $top_items;
113 }
◆ getSubItemsForTable()
ilMMItemRepository::getSubItemsForTable |
( |
| ) |
|
- Returns
- array
Definition at line 150 of file class.ilMMItemRepository.php.
150 : array
151 {
152 $r = $this->storage->db()->query(
153 "SELECT sub_items.*, top_items.position AS parent_position
154FROM il_mm_items AS sub_items
155LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
156WHERE sub_items.parent_identification != '' ORDER BY top_items.position, parent_identification, sub_items.position ASC"
157 );
158 $return = [];
159 while (
$data = $this->storage->db()->fetchAssoc(
$r)) {
161 }
162
163 return $return;
164 }
References $data, and $r.
Referenced by flushLostItems(), and hasLostItems().
◆ getTopItems()
ilMMItemRepository::getTopItems |
( |
| ) |
|
◆ getTypeHandlerForType()
ilMMItemRepository::getTypeHandlerForType |
( |
string |
$type | ) |
|
◆ hasLostItems()
ilMMItemRepository::hasLostItems |
( |
| ) |
|
Definition at line 183 of file class.ilMMItemRepository.php.
183 : bool
184 {
186 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
187 if (Lost::class === $item_facade->getType()) {
188 return true;
189 }
190 }
191
193 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
194 if (Lost::class === $item_facade->getType()) {
195 return true;
196 }
197 }
198 return false;
199 }
References getItemFacade(), getSubItemsForTable(), and getTopItems().
◆ repository()
ilMMItemRepository::repository |
( |
| ) |
|
◆ sync()
ilMMItemRepository::sync |
( |
| ) |
|
|
private |
◆ updateItem()
◆ $main_collector
ilMMItemRepository::$main_collector |
|
private |
◆ $services
ilMMItemRepository::$services |
|
private |
◆ $storage
ilMMItemRepository::$storage |
|
private |
◆ $synced
ilMMItemRepository::$synced = false |
|
private |
The documentation for this class was generated from the following file: