ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
42 
43  public function create()
44  {
45  if (self::find($this->getIdentification())) {
46  $this->update();
47  } else {
48  parent::create();
49  }
50  }
51 
52 
56  public function getCache() : ilGlobalCache
57  {
59  }
60 
61 
71  protected $identification;
79  protected $active = true;
87  protected $position = 0;
95  protected $parent_identification = '';
103  protected $icon_id = '';
107  protected $connector_container_name = "il_mm_items";
108 
109 
113  public function getIdentification() : string
114  {
115  return $this->identification;
116  }
117 
118 
122  public function setIdentification(string $identification)
123  {
124  $this->identification = $identification;
125  }
126 
127 
131  public function isActive() : bool
132  {
133  return $this->active;
134  }
135 
136 
140  public function setActive(bool $active)
141  {
142  $this->active = $active;
143  }
144 
145 
149  public function getPosition() : int
150  {
151  return $this->position;
152  }
153 
154 
158  public function setPosition(int $position)
159  {
160  $this->position = $position;
161  }
162 
163 
167  public function getParentIdentification() : string
168  {
170  }
171 
172 
177  {
178  $this->parent_identification = $parent_identification;
179  }
180 
181 
185  public function getIconId() : ?string
186  {
187  return $this->icon_id;
188  }
189 
190 
196  public function setIconId(string $icon_id) : ilMMItemStorage
197  {
198  $this->icon_id = $icon_id;
199 
200  return $this;
201  }
202 }
static find($primary_key, array $add_constructor_args=array())
Class CachedActiveRecord.
Class ChatMainBarProvider .
static getInstance($component)
setParentIdentification(string $parent_identification)
setPosition(int $position)
Class ilGlobalCache.
setIdentification(string $identification)
setIconId(string $icon_id)