ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMMCustomItemFacade Class Reference

Class ilMMCustomItemFacade. More...

+ Inheritance diagram for ilMMCustomItemFacade:
+ Collaboration diagram for ilMMCustomItemFacade:

Public Member Functions

 __construct (IdentificationInterface $identification, Main $collector)
 
 update ()
 
 delete ()
 
 supportsRoleBasedVisibility ()
 
 isCustom ()
 
 isEditable ()
 
 isDeletable ()
 
 getProviderNameForPresentation ()
 
 getStatus ()
 
 setAction (string $action)
 
 getType ()
 
 setType (string $type)
 
 isTopItem ()
 
 setIsTopItm (bool $top_item)
 
- Public Member Functions inherited from ilMMAbstractItemFacade
 __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 ()
 

Protected Attributes

 $custom_item_storage
 
 $action = ''
 
 $type = ''
 
 $top_item = false
 
- Protected Attributes inherited from ilMMAbstractItemFacade
 $role_based_visibility = false
 
 $global_role_ids = []
 
 $type_information
 
 $mm_item
 
 $raw_item
 
 $filtered_item
 
 $identification
 
 $default_title = "-"
 

Private Member Functions

 getCustomStorage ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilMMAbstractItemFacade
 deleteAssociatedTranslations ()
 deletes all translations associated with the current identification. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMCustomItemFacade::__construct ( IdentificationInterface  $identification,
Main  $collector 
)

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

References ILIAS\GlobalScreen\Provider\__construct(), and getCustomStorage().

34  {
35  parent::__construct($identification, $collector);
36  $this->custom_item_storage = $this->getCustomStorage();
37  if ($this->custom_item_storage instanceof ilMMCustomItemStorage) {
38  if ($this->custom_item_storage->getType()) {
39  $this->type = $this->custom_item_storage->getType();
40  }
41  $this->role_based_visibility = $this->custom_item_storage->hasRoleBasedVisibility();
42  if ($this->custom_item_storage->hasRoleBasedVisibility()) {
43  $this->global_role_ids = $this->custom_item_storage->getGlobalRoleIDs();
44  }
45  }
46  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilMMCustomItemFacade::delete ( )

Implements ilMMItemFacadeInterface.

Definition at line 72 of file class.ilMMCustomItemFacade.php.

References getCustomStorage(), and isDeletable().

73  {
74  if (!$this->isDeletable()) {
75  throw new LogicException("Non Custom items can't be deleted");
76  }
77 
78  $cm = $this->getCustomStorage();
79  if ($cm instanceof ilMMCustomItemStorage) {
80  $cm->delete();
81  }
82  parent::delete();
83  }
+ Here is the call graph for this function:

◆ getCustomStorage()

ilMMCustomItemFacade::getCustomStorage ( )
private
Returns
ilMMCustomItemStorage|null

Definition at line 88 of file class.ilMMCustomItemFacade.php.

References CachedActiveRecord\find().

Referenced by __construct(), delete(), and update().

89  {
90  $id = $this->raw_item->getProviderIdentification()->getInternalIdentifier();
91  $mm = ilMMCustomItemStorage::find($id);
92 
93  return $mm;
94  }
static find($primary_key, array $add_constructor_args=array())
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviderNameForPresentation()

ilMMCustomItemFacade::getProviderNameForPresentation ( )

Implements ilMMItemFacadeInterface.

Definition at line 131 of file class.ilMMCustomItemFacade.php.

131  : string
132  {
133  return "Custom";
134  }

◆ getStatus()

ilMMCustomItemFacade::getStatus ( )
Returns
string

Implements ilMMItemFacadeInterface.

Definition at line 139 of file class.ilMMCustomItemFacade.php.

139  : string
140  {
141  return "";
142  }

◆ getType()

ilMMCustomItemFacade::getType ( )

Implements ilMMItemFacadeInterface.

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

References $type.

Referenced by update().

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

◆ isCustom()

ilMMCustomItemFacade::isCustom ( )

Implements ilMMItemFacadeInterface.

Definition at line 107 of file class.ilMMCustomItemFacade.php.

Referenced by update().

107  : bool
108  {
109  return true;
110  }
+ Here is the caller graph for this function:

◆ isDeletable()

ilMMCustomItemFacade::isDeletable ( )

Implements ilMMItemFacadeInterface.

Definition at line 123 of file class.ilMMCustomItemFacade.php.

Referenced by delete().

123  : bool
124  {
125  return true;
126  }
+ Here is the caller graph for this function:

◆ isEditable()

ilMMCustomItemFacade::isEditable ( )

Implements ilMMItemFacadeInterface.

Definition at line 115 of file class.ilMMCustomItemFacade.php.

115  : bool
116  {
117  return true;
118  }

◆ isTopItem()

ilMMCustomItemFacade::isTopItem ( )

Implements ilMMItemFacadeInterface.

Definition at line 171 of file class.ilMMCustomItemFacade.php.

References $top_item.

171  : bool
172  {
173  if ($this->raw_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem) {
174  return parent::isTopItem();
175  }
176 
177  return $this->top_item;
178  }
Class ChatMainBarProvider .

◆ setAction()

ilMMCustomItemFacade::setAction ( string  $action)

Implements ilMMItemFacadeInterface.

Definition at line 147 of file class.ilMMCustomItemFacade.php.

References $action.

148  {
149  $this->action = $action;
150  }

◆ setIsTopItm()

ilMMCustomItemFacade::setIsTopItm ( bool  $top_item)

Implements ilMMItemFacadeInterface.

Definition at line 183 of file class.ilMMCustomItemFacade.php.

References $top_item.

184  {
185  $this->top_item = $top_item;
186  }

◆ setType()

ilMMCustomItemFacade::setType ( string  $type)

Implements ilMMItemFacadeInterface.

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

References $type.

164  {
165  $this->type = $type;
166  }

◆ supportsRoleBasedVisibility()

ilMMCustomItemFacade::supportsRoleBasedVisibility ( )

Implements ilMMItemFacadeInterface.

Definition at line 99 of file class.ilMMCustomItemFacade.php.

99  : bool
100  {
101  return true;
102  }

◆ update()

ilMMCustomItemFacade::update ( )

Implements ilMMItemFacadeInterface.

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

References ilMMAbstractItemFacade\$default_title, getCustomStorage(), getType(), ilMMAbstractItemFacade\identification(), and isCustom().

52  {
53  if ($this->isCustom()) {
54  $mm = $this->getCustomStorage();
55  if ($mm instanceof ilMMCustomItemStorage) {
56  $default_title = ilMMItemTranslationStorage::getDefaultTranslation($this->identification());
57  $mm->setDefaultTitle($default_title);
58  $mm->setType($this->getType());
59  $mm->setRoleBasedVisibility($this->role_based_visibility);
60  if ($this->role_based_visibility) {
61  $mm->setGlobalRoleIDs($this->global_role_ids);
62  }
63  $mm->update();
64  }
65  }
66  parent::update();
67  }
+ Here is the call graph for this function:

Field Documentation

◆ $action

ilMMCustomItemFacade::$action = ''
protected

Definition at line 20 of file class.ilMMCustomItemFacade.php.

Referenced by setAction().

◆ $custom_item_storage

ilMMCustomItemFacade::$custom_item_storage
protected

Definition at line 16 of file class.ilMMCustomItemFacade.php.

◆ $top_item

ilMMCustomItemFacade::$top_item = false
protected

Definition at line 28 of file class.ilMMCustomItemFacade.php.

Referenced by isTopItem(), and setIsTopItm().

◆ $type

ilMMCustomItemFacade::$type = ''
protected

Definition at line 24 of file class.ilMMCustomItemFacade.php.

Referenced by getType(), and setType().


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