ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMMCustomItemFacade Class Reference

Class ilMMCustomItemFacade. More...

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

Public Member Functions

 __construct (IdentificationInterface $identification, Main $collector)
 
 update ()
 
 delete ()
 
 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 ()
 
 isEmpty ()
 
 itemStorage ()
 
 identification ()
 
 item ()
 
 getAmountOfChildren ()
 
 isAvailable ()
 
 isActivated ()
 
 isAlwaysAvailable ()
 
 getProviderNameForPresentation ()
 
 getDefaultTitle ()
 
 setDefaultTitle (string $default_title)
 
 getStatus ()
 
 getTypeForPresentation ()
 
 getParentIdentificationString ()
 
 isCustomType ()
 
 isTopItem ()
 
 isInLostItem ()
 
 setIsTopItm (bool $top_item)
 
 getType ()
 FSX check if doublette. More...
 
 setParent (string $parent)
 
 setPosition (int $position)
 
Parameters
int$position
More...
 
 setActiveStatus (bool $status)
 
 update ()
 
 create ()
 
 delete ()
 

Protected Attributes

 $custom_item_storage
 
 $action = ''
 
 $type = ''
 
 $top_item = false
 
- Protected Attributes inherited from ilMMAbstractItemFacade
 $type_information
 
 $mm_item
 
 $gs_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 35 of file class.ilMMCustomItemFacade.php.

References getCustomStorage().

36  {
37  parent::__construct($identification, $collector);
38  $this->custom_item_storage = $this->getCustomStorage();
39  if ($this->custom_item_storage instanceof ilMMCustomItemStorage) {
40  if ($this->custom_item_storage->getType()) {
41  $this->type = $this->custom_item_storage->getType();
42  }
43  }
44  }
Class ilMMCustomItemStorage.
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilMMCustomItemFacade::delete ( )

Implements ilMMItemFacadeInterface.

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

References getCustomStorage(), and isDeletable().

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

◆ getCustomStorage()

ilMMCustomItemFacade::getCustomStorage ( )
private
Returns
ilMMCustomItemStorage|null

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

References $id, and CachedActiveRecord\find().

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

86  {
87  $id = $this->gs_item->getProviderIdentification()->getInternalIdentifier();
89 
90  return $mm;
91  }
static find($primary_key, array $add_constructor_args=array())
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviderNameForPresentation()

ilMMCustomItemFacade::getProviderNameForPresentation ( )

Implements ilMMItemFacadeInterface.

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

124  : string
125  {
126  return "Custom";
127  }

◆ getStatus()

ilMMCustomItemFacade::getStatus ( )
Returns
string

Implements ilMMItemFacadeInterface.

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

133  : string
134  {
135  return "";
136  }

◆ getType()

ilMMCustomItemFacade::getType ( )

Implements ilMMItemFacadeInterface.

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

References $type.

Referenced by update().

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

◆ isCustom()

ilMMCustomItemFacade::isCustom ( )

Implements ilMMItemFacadeInterface.

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

Referenced by update().

97  : bool
98  {
99  return true;
100  }
+ Here is the caller graph for this function:

◆ isDeletable()

ilMMCustomItemFacade::isDeletable ( )

Implements ilMMItemFacadeInterface.

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

Referenced by delete().

115  : bool
116  {
117  return true;
118  }
+ Here is the caller graph for this function:

◆ isEditable()

ilMMCustomItemFacade::isEditable ( )

Implements ilMMItemFacadeInterface.

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

106  : bool
107  {
108  return true;
109  }

◆ isTopItem()

ilMMCustomItemFacade::isTopItem ( )

Implements ilMMItemFacadeInterface.

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

References $top_item.

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

◆ setAction()

ilMMCustomItemFacade::setAction ( string  $action)

Implements ilMMItemFacadeInterface.

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

References $action.

143  {
144  $this->action = $action;
145  }

◆ setIsTopItm()

ilMMCustomItemFacade::setIsTopItm ( bool  $top_item)

Implements ilMMItemFacadeInterface.

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

References $top_item.

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

◆ setType()

ilMMCustomItemFacade::setType ( string  $type)

Implements ilMMItemFacadeInterface.

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

References $type.

161  {
162  $this->type = $type;
163  }

◆ update()

ilMMCustomItemFacade::update ( )

Implements ilMMItemFacadeInterface.

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

References ilMMAbstractItemFacade\$default_title, getCustomStorage(), getType(), ilMMAbstractItemFacade\identification(), isCustom(), and League\Flysystem\Adapter\Polyfill\update().

51  {
52  if ($this->isCustom()) {
53  $mm = $this->getCustomStorage();
54  if ($mm instanceof ilMMCustomItemStorage) {
55  $default_title = ilMMItemTranslationStorage::getDefaultTranslation($this->identification());
56  $mm->setDefaultTitle($default_title);
57  $mm->setType($this->getType());
58  $mm->update();
59  }
60  }
62  }
Class ilMMCustomItemStorage.
update($pash, $contents, Config $config)
+ Here is the call graph for this function:

Field Documentation

◆ $action

ilMMCustomItemFacade::$action = ''
protected

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

Referenced by setAction().

◆ $custom_item_storage

ilMMCustomItemFacade::$custom_item_storage
protected

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

◆ $top_item

ilMMCustomItemFacade::$top_item = false
protected

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

Referenced by isTopItem(), and setIsTopItm().

◆ $type

ilMMCustomItemFacade::$type = ''
protected

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

Referenced by getType(), and setType().


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