ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMMAbstractItemFacade Class Reference

Class ilMMAbstractItemFacade. More...

+ Inheritance diagram for ilMMAbstractItemFacade:
+ Collaboration diagram for ilMMAbstractItemFacade:

Public Member Functions

 __construct (\ILIAS\GlobalScreen\Identification\IdentificationInterface $identification, Main $collector)
 ilMMAbstractItemFacade constructor. More...
 
 getId ()
 
 hasStorage ()
 
 supportsRoleBasedVisibility ()
 @inheritDoc More...
 
 hasRoleBasedVisibility ()
 @inheritDoc More...
 
 setRoleBasedVisibility (bool $role_based_visibility)
 @inheritDoc More...
 
 getGlobalRoleIDs ()
 @inheritDoc More...
 
 setGlobalRoleIDs (array $global_role_ids)
 @inheritDoc More...
 
 isEmpty ()
 
 itemStorage ()
 
 identification ()
 
 getRawItem ()
 
 getFilteredItem ()
 
 getAmountOfChildren ()
 
 isAvailable ()
 
 isActivated ()
 @inheritDoc More...
 
 isAlwaysAvailable ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getDefaultTitle ()
 
 setDefaultTitle (string $default_title)
 
 getStatus ()
 
 getTypeForPresentation ()
 
 getParentIdentificationString ()
 
 isCustomType ()
 
 isTopItem ()
 @inheritDoc More...
 
 isChild ()
 
 isInLostItem ()
 @inheritDoc More...
 
 setIsTopItm (bool $top_item)
 @inheritDoc More...
 
 isInterchangeable ()
 @inheritDoc More...
 
 getType ()
 FSX check if doublette @inheritDoc. More...
 
 setParent (string $parent)
 
 setPosition (int $position)
 
Parameters
int$position
More...
 
 setActiveStatus (bool $status)
 
 supportsCustomIcon ()
 
 getIconID ()
 
 setIconID (string $icon_id)
 @inheritDoc More...
 
 update ()
 
 create ()
 
 delete ()
 @inheritDoc More...
 
- Public Member Functions inherited from ilMMItemFacadeInterface
 itemStorage ()
 
 getRawItem ()
 
 getFilteredItem ()
 
 identification ()
 
 getTypeForPresentation ()
 
 getProviderNameForPresentation ()
 
 getStatus ()
 
 isAvailable ()
 
 isActivated ()
 
 isEditable ()
 
 isDeletable ()
 
 isAlwaysAvailable ()
 
 getDefaultTitle ()
 
 getId ()
 
 getAmountOfChildren ()
 
 hasStorage ()
 
 supportsRoleBasedVisibility ()
 
 hasRoleBasedVisibility ()
 
 getGlobalRoleIDs ()
 
 setGlobalRoleIDs (array $global_role_ids)
 
 setRoleBasedVisibility (bool $role_based_visibility)
 
 isEmpty ()
 
 isCustom ()
 
 supportsCustomIcon ()
 
 isCustomType ()
 
 getParentIdentificationString ()
 
 getType ()
 
 isTopItem ()
 
 isChild ()
 
 isInLostItem ()
 
 getIconID ()
 
 setAction (string $action)
 
 setActiveStatus (bool $status)
 
 setDefaultTitle (string $default_title)
 
 setIconID (string $icon_id)
 
 setPosition (int $position)
 
 setParent (string $parent)
 
 setType (string $type)
 
 setIsTopItm (bool $top_item)
 
 isInterchangeable ()
 
 update ()
 
 create ()
 
 delete ()
 

Protected Member Functions

 deleteAssociatedTranslations ()
 deletes all translations associated with the current identification. More...
 

Protected Attributes

 $role_based_visibility = false
 
 $global_role_ids = []
 
 $type_information
 
 $mm_item
 
 $raw_item
 
 $filtered_item
 
 $identification
 
 $default_title = "-"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMAbstractItemFacade::__construct ( \ILIAS\GlobalScreen\Identification\IdentificationInterface  $identification,
Main  $collector 
)

ilMMAbstractItemFacade constructor.

Parameters
\ILIAS\GlobalScreen\Identification\IdentificationInterface$identification
Main$collector
Exceptions
Throwable

Reimplemented in ilMMItemFacade.

Definition at line 65 of file class.ilMMAbstractItemFacade.php.

68 {
70 $this->raw_item = $collector->getSingleItemFromRaw($identification);
71 $this->filtered_item = $collector->getSingleItemFromFilter($identification);
72 $this->type_information = $collector->getTypeInformationCollection()->get(get_class($this->raw_item));
73 $this->mm_item = ilMMItemStorage::register($this->raw_item);
74 }
static register(isItem $item)

References $identification, identification(), and ilMMItemStorage\register().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilMMAbstractItemFacade::create ( )
Returns
void

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 389 of file class.ilMMAbstractItemFacade.php.

390 {
392 $this->mm_item->create();
393 ilMMItemStorage::register($this->raw_item);
394 }
static storeDefaultTranslation(IdentificationInterface $identification, string $translation)

References identification(), ilMMItemStorage\register(), and ilMMItemTranslationStorage\storeDefaultTranslation().

+ Here is the call graph for this function:

◆ delete()

ilMMAbstractItemFacade::delete ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade, and ilMMNullItemFacade.

Definition at line 418 of file class.ilMMAbstractItemFacade.php.

419 {
420 if ($this->isDeletable()) {
422 $serialize = $this->identification->serialize();
423 $mm = ilMMItemStorage::find($serialize);
424 if ($mm instanceof ilMMItemStorage) {
425 $mm->delete();
426 }
427 }
428 }
static find($primary_key, array $add_constructor_args=array())
@inheritDoc
deleteAssociatedTranslations()
deletes all translations associated with the current identification.
Class ilMMItemStorage.

References deleteAssociatedTranslations(), CachedActiveRecord\find(), identification(), and ilMMItemFacadeInterface\isDeletable().

+ Here is the call graph for this function:

◆ deleteAssociatedTranslations()

ilMMAbstractItemFacade::deleteAssociatedTranslations ( )
protected

deletes all translations associated with the current identification.

Exceptions
Exception

Definition at line 400 of file class.ilMMAbstractItemFacade.php.

401 {
403 'identification' => $this->identification->serialize(),
404 ], '=')->get();
405
406 if (!empty($ts)) {
407 foreach ($ts as $translation) {
408 if ($translation instanceof ilMMItemTranslationStorage) {
409 $translation->delete();
410 }
411 }
412 }
413 }
static where($where, $operator=null)
Class ilMMItemTranslationStorage.

References identification(), and ActiveRecord\where().

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAmountOfChildren()

ilMMAbstractItemFacade::getAmountOfChildren ( )
Returns
int

Implements ilMMItemFacadeInterface.

Definition at line 163 of file class.ilMMAbstractItemFacade.php.

163 : int
164 {
165 if ($this->filtered_item instanceof isParent) {
166 return count($this->filtered_item->getChildren());
167 }
168
169 return 0;
170 }

◆ getDefaultTitle()

ilMMAbstractItemFacade::getDefaultTitle ( )
Returns
string

Implements ilMMItemFacadeInterface.

Definition at line 204 of file class.ilMMAbstractItemFacade.php.

204 : string
205 {
206 $default_translation = ilMMItemTranslationStorage::getDefaultTranslation($this->identification);
207 if ($default_translation !== "") {
208 return $default_translation;
209 }
210 if ($this->default_title == "-" && $this->raw_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle) {
211 $this->default_title = $this->raw_item->getTitle();
212 }
213
215 }
Class ChatMainBarProvider \MainMenu\Provider.

References $default_title, and identification().

+ Here is the call graph for this function:

◆ getFilteredItem()

ilMMAbstractItemFacade::getFilteredItem ( )

Implements ilMMItemFacadeInterface.

Definition at line 158 of file class.ilMMAbstractItemFacade.php.

References $filtered_item.

Referenced by getParentIdentificationString(), and isChild().

+ Here is the caller graph for this function:

◆ getGlobalRoleIDs()

ilMMAbstractItemFacade::getGlobalRoleIDs ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 116 of file class.ilMMAbstractItemFacade.php.

116 : array
117 {
119 }

References $global_role_ids.

◆ getIconID()

ilMMAbstractItemFacade::getIconID ( )

Implements ilMMItemFacadeInterface.

Definition at line 368 of file class.ilMMAbstractItemFacade.php.

368 : ?string
369 {
370 return $this->mm_item->getIconId();
371 }

◆ getId()

ilMMAbstractItemFacade::getId ( )
Returns
string

Implements ilMMItemFacadeInterface.

Definition at line 76 of file class.ilMMAbstractItemFacade.php.

76 : string
77 {
78 return $this->identification->serialize();
79 }

References identification().

Referenced by hasStorage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentIdentificationString()

ilMMAbstractItemFacade::getParentIdentificationString ( )
Returns
string

Implements ilMMItemFacadeInterface.

Definition at line 247 of file class.ilMMAbstractItemFacade.php.

247 : string
248 {
249 if ($this->getFilteredItem() instanceof isChild || $this->getFilteredItem() instanceof isInterchangeableItem) {
250 $provider_name_for_presentation = $this->raw_item->getParent()->serialize();
251
252 $storage_parent = $this->mm_item->getParentIdentification();
253 if ($storage_parent !== $provider_name_for_presentation) {
254 return $storage_parent;
255 }
256
257 return $provider_name_for_presentation;
258 }
259
260 return "";
261 }

References getFilteredItem().

+ Here is the call graph for this function:

◆ getProviderNameForPresentation()

ilMMAbstractItemFacade::getProviderNameForPresentation ( )
Returns
string

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade, and ilMMNullItemFacade.

Definition at line 196 of file class.ilMMAbstractItemFacade.php.

196 : string
197 {
198 return $this->identification->getProviderNameForPresentation();
199 }

References identification().

+ Here is the call graph for this function:

◆ getRawItem()

ilMMAbstractItemFacade::getRawItem ( )

Implements ilMMItemFacadeInterface.

Definition at line 154 of file class.ilMMAbstractItemFacade.php.

References $raw_item.

Referenced by isActivated(), and isAlwaysAvailable().

+ Here is the caller graph for this function:

◆ getStatus()

ilMMAbstractItemFacade::getStatus ( )
Returns
string

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade.

Definition at line 228 of file class.ilMMAbstractItemFacade.php.

228 : string
229 {
230 global $DIC;
231 if (!$this->raw_item->isAvailable() || $this->raw_item->isAlwaysAvailable()) {
232 return $DIC->ui()->renderer()->render($this->raw_item->getNonAvailableReason());
233 }
234
235 return "";
236 }
global $DIC
Definition: goto.php:24

References $DIC.

◆ getType()

ilMMAbstractItemFacade::getType ( )

FSX check if doublette @inheritDoc.

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade.

Definition at line 334 of file class.ilMMAbstractItemFacade.php.

334 : string
335 {
336 return $this->type_information->getType();
337 }

◆ getTypeForPresentation()

ilMMAbstractItemFacade::getTypeForPresentation ( )
Returns
string
Exceptions
ReflectionException

Implements ilMMItemFacadeInterface.

Definition at line 242 of file class.ilMMAbstractItemFacade.php.

242 : string
243 {
244 return $this->type_information->getTypeNameForPresentation();
245 }

◆ hasRoleBasedVisibility()

ilMMAbstractItemFacade::hasRoleBasedVisibility ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 100 of file class.ilMMAbstractItemFacade.php.

100 : bool
101 {
103 }

References $role_based_visibility.

◆ hasStorage()

ilMMAbstractItemFacade::hasStorage ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Definition at line 84 of file class.ilMMAbstractItemFacade.php.

84 : bool
85 {
86 return ilMMItemStorage::find($this->getId()) !== null;
87 }

References CachedActiveRecord\find(), and getId().

+ Here is the call graph for this function:

◆ identification()

ilMMAbstractItemFacade::identification ( )
Returns
\ILIAS\GlobalScreen\Identification\IdentificationInterface

Implements ilMMItemFacadeInterface.

Definition at line 148 of file class.ilMMAbstractItemFacade.php.

References $identification.

Referenced by __construct(), create(), delete(), deleteAssociatedTranslations(), getDefaultTitle(), getId(), getProviderNameForPresentation(), update(), and ilMMCustomItemFacade\update().

+ Here is the caller graph for this function:

◆ isActivated()

ilMMAbstractItemFacade::isActivated ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 180 of file class.ilMMAbstractItemFacade.php.

180 : bool
181 {
182 return (bool) ($this->mm_item->isActive() && $this->getRawItem()->isAvailable()) || $this->getRawItem()->isAlwaysAvailable();
183 }

References getRawItem().

+ Here is the call graph for this function:

◆ isAlwaysAvailable()

ilMMAbstractItemFacade::isAlwaysAvailable ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 188 of file class.ilMMAbstractItemFacade.php.

188 : bool
189 {
190 return $this->getRawItem()->isAlwaysAvailable();
191 }

References getRawItem().

+ Here is the call graph for this function:

◆ isAvailable()

ilMMAbstractItemFacade::isAvailable ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 172 of file class.ilMMAbstractItemFacade.php.

172 : bool
173 {
174 return (bool) ($this->filtered_item->isAvailable() || $this->filtered_item->isAlwaysAvailable());
175 }

◆ isChild()

ilMMAbstractItemFacade::isChild ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Definition at line 295 of file class.ilMMAbstractItemFacade.php.

295 : bool
296 {
297 $item = $this->getFilteredItem();
298 return $item instanceof isChild
299 || ($item instanceof isInterchangeableItem && $item->hasChanged());
300 }

References getFilteredItem(), and ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem\hasChanged().

+ Here is the call graph for this function:

◆ isCustomType()

ilMMAbstractItemFacade::isCustomType ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Definition at line 266 of file class.ilMMAbstractItemFacade.php.

266 : bool
267 {
268 $known_core_types = [
269 Complex::class,
270 Link::class,
271 LinkList::class,
272 Lost::class,
273 RepositoryLink::class,
274 Separator::class,
275 TopLinkItem::class,
276 TopParentItem::class,
277 ];
278 foreach ($known_core_types as $known_core_type) {
279 if (get_class($this->raw_item) === $known_core_type) {
280 return false;
281 }
282 }
283
284 return true;
285 }

◆ isEmpty()

ilMMAbstractItemFacade::isEmpty ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 132 of file class.ilMMAbstractItemFacade.php.

132 : bool
133 {
134 return $this->mm_item->getIdentification() == '';
135 }

◆ isInLostItem()

ilMMAbstractItemFacade::isInLostItem ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 305 of file class.ilMMAbstractItemFacade.php.

305 : bool
306 {
307 if ($this->raw_item instanceof isChild) {
308 return $this->raw_item->getParent() instanceof NullIdentification;
309 }
310
311 return false;
312 }

◆ isInterchangeable()

ilMMAbstractItemFacade::isInterchangeable ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 325 of file class.ilMMAbstractItemFacade.php.

325 : bool
326 {
327 return $this->raw_item instanceof isInterchangeableItem;
328 }

◆ isTopItem()

ilMMAbstractItemFacade::isTopItem ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade, and ilMMNullItemFacade.

Definition at line 290 of file class.ilMMAbstractItemFacade.php.

290 : bool
291 {
292 return $this->raw_item instanceof isTopItem;
293 }

References isTopItem().

Referenced by isTopItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemStorage()

ilMMAbstractItemFacade::itemStorage ( )
Returns
ilMMItemStorage

Implements ilMMItemFacadeInterface.

Definition at line 140 of file class.ilMMAbstractItemFacade.php.

References $mm_item.

◆ setActiveStatus()

ilMMAbstractItemFacade::setActiveStatus ( bool  $status)
Parameters
bool$status

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 358 of file class.ilMMAbstractItemFacade.php.

359 {
360 $this->mm_item->setActive($status);
361 }

◆ setDefaultTitle()

ilMMAbstractItemFacade::setDefaultTitle ( string  $default_title)
Parameters
string$default_title

Implements ilMMItemFacadeInterface.

Definition at line 220 of file class.ilMMAbstractItemFacade.php.

221 {
222 $this->default_title = $default_title;
223 }

References $default_title.

◆ setGlobalRoleIDs()

ilMMAbstractItemFacade::setGlobalRoleIDs ( array  $global_role_ids)

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 124 of file class.ilMMAbstractItemFacade.php.

124 : void
125 {
126 $this->global_role_ids = $global_role_ids;
127 }

References $global_role_ids.

◆ setIconID()

ilMMAbstractItemFacade::setIconID ( string  $icon_id)

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 376 of file class.ilMMAbstractItemFacade.php.

377 {
378 $this->mm_item->setIconId($icon_id);
379 }

◆ setIsTopItm()

ilMMAbstractItemFacade::setIsTopItm ( bool  $top_item)

@inheritDoc

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade, and ilMMNullItemFacade.

Definition at line 317 of file class.ilMMAbstractItemFacade.php.

318 {
319 // TODO: Implement setIsTopItm() method.
320 }

◆ setParent()

ilMMAbstractItemFacade::setParent ( string  $parent)
Parameters
string$parent

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMNullItemFacade.

Definition at line 342 of file class.ilMMAbstractItemFacade.php.

343 {
344 $this->mm_item->setParentIdentification($parent);
345 }

◆ setPosition()

ilMMAbstractItemFacade::setPosition ( int  $position)

Parameters
int$position

Implements ilMMItemFacadeInterface.

Definition at line 350 of file class.ilMMAbstractItemFacade.php.

351 {
352 $this->mm_item->setPosition($position);
353 }

◆ setRoleBasedVisibility()

ilMMAbstractItemFacade::setRoleBasedVisibility ( bool  $role_based_visibility)

@inheritDoc

Implements ilMMItemFacadeInterface.

Definition at line 108 of file class.ilMMAbstractItemFacade.php.

108 : void
109 {
110 $this->role_based_visibility = $role_based_visibility;
111 }

References $role_based_visibility.

◆ supportsCustomIcon()

ilMMAbstractItemFacade::supportsCustomIcon ( )
Returns
bool

Implements ilMMItemFacadeInterface.

Definition at line 363 of file class.ilMMAbstractItemFacade.php.

363 : bool
364 {
365 return $this->raw_item instanceof hasSymbol;
366 }

References ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol().

+ Here is the call graph for this function:

◆ supportsRoleBasedVisibility()

ilMMAbstractItemFacade::supportsRoleBasedVisibility ( )

@inheritDoc

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade, and ilMMNullItemFacade.

Definition at line 92 of file class.ilMMAbstractItemFacade.php.

92 : bool
93 {
94 return false;
95 }

◆ update()

ilMMAbstractItemFacade::update ( )
Returns
void

Implements ilMMItemFacadeInterface.

Reimplemented in ilMMCustomItemFacade.

Definition at line 383 of file class.ilMMAbstractItemFacade.php.

384 {
386 $this->mm_item->update();
387 }

References identification(), and ilMMItemTranslationStorage\storeDefaultTranslation().

+ Here is the call graph for this function:

Field Documentation

◆ $default_title

ilMMAbstractItemFacade::$default_title = "-"
protected

◆ $filtered_item

ilMMAbstractItemFacade::$filtered_item
protected

Definition at line 49 of file class.ilMMAbstractItemFacade.php.

Referenced by getFilteredItem().

◆ $global_role_ids

ilMMAbstractItemFacade::$global_role_ids = []
protected

Definition at line 33 of file class.ilMMAbstractItemFacade.php.

Referenced by getGlobalRoleIDs(), and setGlobalRoleIDs().

◆ $identification

ilMMAbstractItemFacade::$identification
protected

◆ $mm_item

ilMMAbstractItemFacade::$mm_item
protected

Definition at line 41 of file class.ilMMAbstractItemFacade.php.

Referenced by itemStorage().

◆ $raw_item

ilMMAbstractItemFacade::$raw_item
protected

Definition at line 45 of file class.ilMMAbstractItemFacade.php.

Referenced by getRawItem().

◆ $role_based_visibility

ilMMAbstractItemFacade::$role_based_visibility = false
protected

◆ $type_information

ilMMAbstractItemFacade::$type_information
protected

Definition at line 37 of file class.ilMMAbstractItemFacade.php.


The documentation for this class was generated from the following file: