ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMMItemStorage.php
Go to the documentation of this file.
1<?php
2
5
12{
13
19 public static function register(isItem $item) : ilMMItemStorage
20 {
21 if ($item instanceof Lost) {
22 return new self();
23 }
24
25 $mm_item = ilMMItemStorage::find($item->getProviderIdentification()->serialize());
26 if ($mm_item === null) {
27 $mm_item = new ilMMItemStorage();
28 $mm_item->setPosition($item->getPosition());
29 $mm_item->setIdentification($item->getProviderIdentification()->serialize());
30 $mm_item->setActive(true);
31 if ($item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
32 $mm_item->setParentIdentification($item->getParent()->serialize());
33 }
34 $mm_item->create();
35 }
36
37 return $mm_item;
38 }
39
40
41 public function create()
42 {
43 if (self::find($this->getIdentification())) {
44 $this->update();
45 } else {
46 parent::create();
47 }
48 }
49
50
54 public function getCache() : ilGlobalCache
55 {
57 }
58
59
69 protected $identification;
77 protected $active = true;
85 protected $position = 0;
93 protected $parent_identification = '';
97 protected $connector_container_name = "il_mm_items";
98
99
103 public function getIdentification() : string
104 {
106 }
107
108
112 public function setIdentification(string $identification)
113 {
114 $this->identification = $identification;
115 }
116
117
121 public function isActive() : bool
122 {
123 return $this->active;
124 }
125
126
130 public function setActive(bool $active)
131 {
132 $this->active = $active;
133 }
134
135
139 public function getPosition() : int
140 {
141 return $this->position;
142 }
143
144
148 public function setPosition(int $position)
149 {
150 $this->position = $position;
151 }
152
153
157 public function getParentIdentification() : string
158 {
160 }
161
162
167 {
168 $this->parent_identification = $parent_identification;
169 }
170}
An exception for terminatinating execution or to throw for unit testing.
Class CachedActiveRecord.
static find($primary_key, array $add_constructor_args=array())
@inheritDoc
Class ilGlobalCache.
static getInstance($component)
Class ilMMItemStorage.
setPosition(int $position)
setParentIdentification(string $parent_identification)
setIdentification(string $identification)
Class BaseForm.