ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 hasRoleBasedVisibility ()
 
 setRoleBasedVisibility (bool $role_based_visibility)
 
 getGlobalRoleIDs ()
 
 setGlobalRoleIDs (array $global_role_ids)
 
 isEmpty ()
 
 itemStorage ()
 
 identification ()
 
 getRawItem ()
 
 getFilteredItem ()
 
 getAmountOfChildren ()
 
 isAvailable ()
 
 isActivated ()
 
 isAlwaysAvailable ()
 
 getProviderNameForPresentation ()
 
 getDefaultTitle ()
 
 setDefaultTitle (string $default_title)
 
 getStatus ()
 
 getTypeForPresentation ()
 
 getParentIdentificationString ()
 
 isCustomType ()
 
 isTopItem ()
 
 isChild ()
 
 isInLostItem ()
 
 setIsTopItm (bool $top_item)
 
 isInterchangeable ()
 
 getType ()
 FSX check if doublette . More...
 
 setParent (string $parent)
 
 setPosition (int $position)
 
Parameters
int$position
More...
 
 setActiveStatus (bool $status)
 
 supportsCustomIcon ()
 
 getIconID ()
 
 setIconID (string $icon_id)
 
 update ()
 
 create ()
 
 delete ()
 
- Public Member Functions inherited from ilMMItemFacadeInterface
 isEditable ()
 
 isDeletable ()
 
 isCustom ()
 
 setAction (string $action)
 
 setType (string $type)
 

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

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

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

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilMMAbstractItemFacade::create ( )
Returns
void

Implements ilMMItemFacadeInterface.

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

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

388  {
390  $this->mm_item->create();
391  ilMMItemStorage::register($this->raw_item);
392  }
static storeDefaultTranslation(IdentificationInterface $identification, string $translation)
static register(isItem $item)
+ Here is the call graph for this function:

◆ delete()

ilMMAbstractItemFacade::delete ( )

Implements ilMMItemFacadeInterface.

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

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

417  {
418  if ($this->isDeletable()) {
420  $serialize = $this->identification->serialize();
421  $mm = ilMMItemStorage::find($serialize);
422  if ($mm instanceof ilMMItemStorage) {
423  $mm->delete();
424  }
425  }
426  }
deleteAssociatedTranslations()
deletes all translations associated with the current identification.
static find($primary_key, array $add_constructor_args=array())
+ 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 398 of file class.ilMMAbstractItemFacade.php.

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

Referenced by delete().

399  {
401  'identification' => $this->identification->serialize(),
402  ], '=')->get();
403 
404  if (!empty($ts)) {
405  foreach ($ts as $translation) {
406  if ($translation instanceof ilMMItemTranslationStorage) {
407  $translation->delete();
408  }
409  }
410  }
411  }
static where($where, $operator=null)
Class ilMMItemTranslationStorage.
+ 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.

References $default_title, and identification().

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 
214  return $this->default_title;
215  }
Class ChatMainBarProvider .
+ 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.

◆ getGlobalRoleIDs()

ilMMAbstractItemFacade::getGlobalRoleIDs ( )

Implements ilMMItemFacadeInterface.

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

References $global_role_ids.

116  : array
117  {
118  return $this->global_role_ids;
119  }

◆ getIconID()

ilMMAbstractItemFacade::getIconID ( )

Implements ilMMItemFacadeInterface.

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

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

◆ getId()

ilMMAbstractItemFacade::getId ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References identification().

Referenced by hasStorage().

76  : string
77  {
78  return $this->identification->serialize();
79  }
+ 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->raw_item instanceof isChild) {
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  }

◆ getProviderNameForPresentation()

ilMMAbstractItemFacade::getProviderNameForPresentation ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References identification().

196  : string
197  {
198  return $this->identification->getProviderNameForPresentation();
199  }
+ 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(), isAlwaysAvailable(), and isChild().

+ Here is the caller graph for this function:

◆ getStatus()

ilMMAbstractItemFacade::getStatus ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References $DIC.

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  }
$DIC
Definition: xapitoken.php:46

◆ getType()

ilMMAbstractItemFacade::getType ( )

FSX check if doublette .

Implements ilMMItemFacadeInterface.

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

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

◆ 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 ( )

Implements ilMMItemFacadeInterface.

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

References $role_based_visibility.

100  : bool
101  {
103  }

◆ hasStorage()

ilMMAbstractItemFacade::hasStorage ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

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

84  : bool
85  {
86  return ilMMItemStorage::find($this->getId()) !== null;
87  }
static find($primary_key, array $add_constructor_args=array())
+ Here is the call graph for this function:

◆ identification()

◆ isActivated()

ilMMAbstractItemFacade::isActivated ( )

Implements ilMMItemFacadeInterface.

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

References getRawItem().

180  : bool
181  {
182  return (bool) ($this->mm_item->isActive() && $this->getRawItem()->isAvailable()) || $this->getRawItem()->isAlwaysAvailable();
183  }
+ Here is the call graph for this function:

◆ isAlwaysAvailable()

ilMMAbstractItemFacade::isAlwaysAvailable ( )

Implements ilMMItemFacadeInterface.

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

References getRawItem().

188  : bool
189  {
190  return $this->getRawItem()->isAlwaysAvailable();
191  }
+ Here is the call graph for this function:

◆ isAvailable()

ilMMAbstractItemFacade::isAvailable ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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.

References getRawItem().

295  : bool
296  {
297  return $this->getRawItem() instanceof isChild;
298  }
+ 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.

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

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

◆ isInLostItem()

ilMMAbstractItemFacade::isInLostItem ( )

Implements ilMMItemFacadeInterface.

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

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

◆ isInterchangeable()

ilMMAbstractItemFacade::isInterchangeable ( )

Implements ilMMItemFacadeInterface.

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

323  : bool
324  {
325  return false;
326  }

◆ isTopItem()

ilMMAbstractItemFacade::isTopItem ( )

Implements ilMMItemFacadeInterface.

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

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

◆ itemStorage()

ilMMAbstractItemFacade::itemStorage ( )

◆ setActiveStatus()

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

Implements ilMMItemFacadeInterface.

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

357  {
358  $this->mm_item->setActive($status);
359  }

◆ setDefaultTitle()

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

Implements ilMMItemFacadeInterface.

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

References $default_title.

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

◆ setGlobalRoleIDs()

ilMMAbstractItemFacade::setGlobalRoleIDs ( array  $global_role_ids)

Implements ilMMItemFacadeInterface.

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

References $global_role_ids.

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

◆ setIconID()

ilMMAbstractItemFacade::setIconID ( string  $icon_id)

Implements ilMMItemFacadeInterface.

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

375  {
376  $this->mm_item->setIconId($icon_id);
377  }

◆ setIsTopItm()

ilMMAbstractItemFacade::setIsTopItm ( bool  $top_item)

Implements ilMMItemFacadeInterface.

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

316  {
317  // TODO: Implement setIsTopItm() method.
318  }

◆ setParent()

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

Implements ilMMItemFacadeInterface.

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

341  {
342  $this->mm_item->setParentIdentification($parent);
343  }

◆ setPosition()

ilMMAbstractItemFacade::setPosition ( int  $position)

Parameters
int$position

Implements ilMMItemFacadeInterface.

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

349  {
350  $this->mm_item->setPosition($position);
351  }

◆ setRoleBasedVisibility()

ilMMAbstractItemFacade::setRoleBasedVisibility ( bool  $role_based_visibility)

Implements ilMMItemFacadeInterface.

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

References $role_based_visibility.

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

◆ supportsCustomIcon()

ilMMAbstractItemFacade::supportsCustomIcon ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

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

361  : bool
362  {
363  return $this->raw_item instanceof hasSymbol;
364  }
+ Here is the call graph for this function:

◆ supportsRoleBasedVisibility()

ilMMAbstractItemFacade::supportsRoleBasedVisibility ( )

Implements ilMMItemFacadeInterface.

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

92  : bool
93  {
94  return false;
95  }

◆ update()

ilMMAbstractItemFacade::update ( )
Returns
void

Implements ilMMItemFacadeInterface.

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

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

382  {
384  $this->mm_item->update();
385  }
static storeDefaultTranslation(IdentificationInterface $identification, string $translation)
+ 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: