ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMMAbstractItemFacade Class Reference

Class ilMMAbstractItemFacade. More...

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

Public Member Functions

 __construct (protected 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

bool $role_based_visibility = false
 
array $global_role_ids = []
 
TypeInformation $type_information
 
ilMMItemStorage $mm_item
 
isItem $filtered_item
 
isItem $raw_item
 
string $default_title = "-"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMAbstractItemFacade::__construct ( protected IdentificationInterface  $identification,
Main  $collector 
)

ilMMAbstractItemFacade constructor.

Parameters
IdentificationInterface$identification
Main$collector
Exceptions
Throwable

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

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

67  {
68  $this->raw_item = $collector->getSingleItemFromRaw($this->identification);
69  $this->filtered_item = $collector->getSingleItemFromFilter($this->identification);
70  $this->type_information = $collector->getTypeInformationCollection()->get($this->raw_item::class);
71  $this->mm_item = ilMMItemStorage::register($this->raw_item);
72  }
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 386 of file class.ilMMAbstractItemFacade.php.

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

386  : void
387  {
389  $this->mm_item->create();
390  ilMMItemStorage::register($this->raw_item);
391  }
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 415 of file class.ilMMAbstractItemFacade.php.

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

415  : void
416  {
417  if ($this->isDeletable()) {
419  $serialize = $this->identification->serialize();
420  $mm = ilMMItemStorage::find($serialize);
421  if ($mm instanceof ilMMItemStorage) {
422  $mm->delete();
423  }
424  }
425  }
deleteAssociatedTranslations()
deletes all translations associated with the current identification.
+ 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 397 of file class.ilMMAbstractItemFacade.php.

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

Referenced by delete().

397  : void
398  {
400  'identification' => $this->identification->serialize(),
401  ], '=')->get();
402 
403  if (!empty($ts)) {
404  foreach ($ts as $translation) {
405  if ($translation instanceof ilMMItemTranslationStorage) {
406  $translation->delete();
407  }
408  }
409  }
410  }
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 160 of file class.ilMMAbstractItemFacade.php.

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

◆ getDefaultTitle()

ilMMAbstractItemFacade::getDefaultTitle ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References $default_title, and identification().

207  : string
208  {
209  $default_translation = ilMMItemTranslationStorage::getDefaultTranslation($this->identification);
210  if ($default_translation !== "") {
211  return $default_translation;
212  }
213  if ($this->default_title === "-" && $this->raw_item instanceof hasTitle) {
214  $this->default_title = $this->raw_item->getTitle();
215  }
216 
217  return $this->default_title;
218  }
+ Here is the call graph for this function:

◆ getFilteredItem()

ilMMAbstractItemFacade::getFilteredItem ( )

Implements ilMMItemFacadeInterface.

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

References $filtered_item.

Referenced by getParentIdentificationString(), and isChild().

155  : isItem
156  {
157  return $this->filtered_item;
158  }
+ Here is the caller graph for this function:

◆ getGlobalRoleIDs()

ilMMAbstractItemFacade::getGlobalRoleIDs ( )

Implements ilMMItemFacadeInterface.

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

References $global_role_ids.

114  : array
115  {
116  return $this->global_role_ids;
117  }

◆ getIconID()

ilMMAbstractItemFacade::getIconID ( )

Implements ilMMItemFacadeInterface.

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

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

◆ getId()

ilMMAbstractItemFacade::getId ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References identification().

Referenced by hasStorage().

74  : string
75  {
76  return $this->identification->serialize();
77  }
+ 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 250 of file class.ilMMAbstractItemFacade.php.

References getFilteredItem().

250  : string
251  {
252  if ($this->getFilteredItem() instanceof isChild || $this->getFilteredItem() instanceof isInterchangeableItem) {
253  $provider_name_for_presentation = $this->raw_item->getParent()->serialize();
254 
255  $storage_parent = $this->mm_item->getParentIdentification();
256  if ($storage_parent !== $provider_name_for_presentation) {
257  return $storage_parent;
258  }
259 
260  return $provider_name_for_presentation;
261  }
262 
263  return "";
264  }
+ Here is the call graph for this function:

◆ getProviderNameForPresentation()

ilMMAbstractItemFacade::getProviderNameForPresentation ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References identification().

199  : string
200  {
201  return $this->identification->getProviderNameForPresentation();
202  }
+ Here is the call graph for this function:

◆ getRawItem()

ilMMAbstractItemFacade::getRawItem ( )

Implements ilMMItemFacadeInterface.

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

References $raw_item.

Referenced by isActivated(), and isAlwaysAvailable().

151  : isItem
152  {
153  return $this->raw_item;
154  }
+ Here is the caller graph for this function:

◆ getStatus()

ilMMAbstractItemFacade::getStatus ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

References $DIC.

231  : string
232  {
233  global $DIC;
234  if (!$this->raw_item->isAvailable() || $this->raw_item->isAlwaysAvailable()) {
235  return $DIC->ui()->renderer()->render($this->raw_item->getNonAvailableReason());
236  }
237 
238  return "";
239  }
global $DIC
Definition: shib_login.php:22

◆ getType()

ilMMAbstractItemFacade::getType ( )

FSX check if doublette .

Implements ilMMItemFacadeInterface.

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

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

◆ getTypeForPresentation()

ilMMAbstractItemFacade::getTypeForPresentation ( )
Returns
string
Exceptions
ReflectionException

Implements ilMMItemFacadeInterface.

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

245  : string
246  {
247  return $this->type_information->getTypeNameForPresentation();
248  }

◆ hasRoleBasedVisibility()

ilMMAbstractItemFacade::hasRoleBasedVisibility ( )

Implements ilMMItemFacadeInterface.

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

References $role_based_visibility.

98  : bool
99  {
101  }

◆ hasStorage()

ilMMAbstractItemFacade::hasStorage ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

References getId(), and null.

82  : bool
83  {
84  return ilMMItemStorage::find($this->getId()) !== null;
85  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ identification()

ilMMAbstractItemFacade::identification ( )
Returns
IdentificationInterface

Implements ilMMItemFacadeInterface.

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

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

147  {
148  return $this->identification;
149  }
+ Here is the caller graph for this function:

◆ isActivated()

ilMMAbstractItemFacade::isActivated ( )

Implements ilMMItemFacadeInterface.

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

References getRawItem().

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

◆ isAlwaysAvailable()

ilMMAbstractItemFacade::isAlwaysAvailable ( )

Implements ilMMItemFacadeInterface.

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

References getRawItem().

191  : bool
192  {
193  return $this->getRawItem()->isAlwaysAvailable();
194  }
+ Here is the call graph for this function:

◆ isAvailable()

ilMMAbstractItemFacade::isAvailable ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

169  : bool
170  {
171  if ($this->filtered_item->isAvailable()) {
172  return true;
173  }
174  return $this->filtered_item->isAlwaysAvailable();
175  }

◆ isChild()

ilMMAbstractItemFacade::isChild ( )

◆ isCustomType()

ilMMAbstractItemFacade::isCustomType ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

269  : bool
270  {
271  $known_core_types = [
272  Complex::class,
273  Link::class,
274  LinkList::class,
275  Lost::class,
276  RepositoryLink::class,
277  Separator::class,
278  TopLinkItem::class,
279  TopParentItem::class,
280  ];
281  return !in_array($this->raw_item::class, $known_core_types, true);
282  }

◆ isEmpty()

ilMMAbstractItemFacade::isEmpty ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

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

◆ isInLostItem()

ilMMAbstractItemFacade::isInLostItem ( )

Implements ilMMItemFacadeInterface.

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

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

◆ isInterchangeable()

ilMMAbstractItemFacade::isInterchangeable ( )

Implements ilMMItemFacadeInterface.

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

322  : bool
323  {
324  return $this->raw_item instanceof isInterchangeableItem;
325  }

◆ isTopItem()

ilMMAbstractItemFacade::isTopItem ( )

Implements ilMMItemFacadeInterface.

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

287  : bool
288  {
289  return $this->raw_item instanceof isTopItem;
290  }

◆ itemStorage()

ilMMAbstractItemFacade::itemStorage ( )
Returns
ilMMItemStorage

Implements ilMMItemFacadeInterface.

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

References $mm_item.

139  {
140  return $this->mm_item;
141  }

◆ setActiveStatus()

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

Implements ilMMItemFacadeInterface.

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

355  : void
356  {
357  $this->mm_item->setActive($status);
358  }

◆ setDefaultTitle()

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

Implements ilMMItemFacadeInterface.

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

References $default_title.

223  : void
224  {
225  $this->default_title = $default_title;
226  }

◆ setGlobalRoleIDs()

ilMMAbstractItemFacade::setGlobalRoleIDs ( array  $global_role_ids)

Implements ilMMItemFacadeInterface.

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

References $global_role_ids.

122  : void
123  {
124  $this->global_role_ids = $global_role_ids;
125  }

◆ setIconID()

ilMMAbstractItemFacade::setIconID ( string  $icon_id)

Implements ilMMItemFacadeInterface.

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

373  : void
374  {
375  $this->mm_item->setIconId($icon_id);
376  }

◆ setIsTopItm()

ilMMAbstractItemFacade::setIsTopItm ( bool  $top_item)

Implements ilMMItemFacadeInterface.

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

314  : void
315  {
316  // TODO: Implement setIsTopItm() method.
317  }

◆ setParent()

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

Implements ilMMItemFacadeInterface.

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

339  : void
340  {
341  $this->mm_item->setParentIdentification($parent);
342  }

◆ setPosition()

ilMMAbstractItemFacade::setPosition ( int  $position)

Parameters
int$position

Implements ilMMItemFacadeInterface.

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

347  : void
348  {
349  $this->mm_item->setPosition($position);
350  }

◆ setRoleBasedVisibility()

ilMMAbstractItemFacade::setRoleBasedVisibility ( bool  $role_based_visibility)

Implements ilMMItemFacadeInterface.

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

References $role_based_visibility.

106  : void
107  {
108  $this->role_based_visibility = $role_based_visibility;
109  }

◆ supportsCustomIcon()

ilMMAbstractItemFacade::supportsCustomIcon ( )
Returns
bool

Implements ilMMItemFacadeInterface.

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

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

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

◆ supportsRoleBasedVisibility()

ilMMAbstractItemFacade::supportsRoleBasedVisibility ( )

Implements ilMMItemFacadeInterface.

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

90  : bool
91  {
92  return false;
93  }

◆ update()

ilMMAbstractItemFacade::update ( )
Returns
void

Implements ilMMItemFacadeInterface.

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

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

380  : void
381  {
383  $this->mm_item->update();
384  }
static storeDefaultTranslation(IdentificationInterface $identification, string $translation)
+ Here is the call graph for this function:

Field Documentation

◆ $default_title

string ilMMAbstractItemFacade::$default_title = "-"
protected

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

Referenced by getDefaultTitle(), and setDefaultTitle().

◆ $filtered_item

isItem ilMMAbstractItemFacade::$filtered_item
protected

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

Referenced by getFilteredItem().

◆ $global_role_ids

array ilMMAbstractItemFacade::$global_role_ids = []
protected

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

Referenced by getGlobalRoleIDs(), and setGlobalRoleIDs().

◆ $mm_item

ilMMItemStorage ilMMAbstractItemFacade::$mm_item
protected

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

Referenced by itemStorage().

◆ $raw_item

isItem ilMMAbstractItemFacade::$raw_item
protected

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

Referenced by getRawItem().

◆ $role_based_visibility

bool ilMMAbstractItemFacade::$role_based_visibility = false
protected

◆ $type_information

TypeInformation ilMMAbstractItemFacade::$type_information
protected

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


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