ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMMNullItemFacade.php
Go to the documentation of this file.
1<?php
2
5
12{
13
25 protected $top_item = false;
26
27
31 public function __construct(IdentificationInterface $identification, Main $collector)
32 {
34 parent::__construct($identification, $collector);
35 }
36
37
41 public function isTopItem() : bool
42 {
43 return $this->top_item;
44 }
45
46
50 public function setIsTopItm(bool $top_item)
51 {
52 $this->top_item = $top_item;
53 }
54
55
59 public function isEmpty() : bool
60 {
61 return true;
62 }
63
64
68 public function setActiveStatus(bool $status)
69 {
70 $this->active_status = $status;
71 }
72
73
77 public function setParent(string $parent)
78 {
79 $this->parent_identification = $parent;
80 }
81
82
83 public function create()
84 {
86 $s->setIdentifier(uniqid());
87 $s->setType($this->type);
88 $s->setTopItem($this->isTopItem());
89 $s->setAction($this->action);
90 $s->setDefaultTitle($this->default_title);
91 $s->create();
92
93 $this->custom_item_storage = $s;
94
95 global $DIC;
97 $this->gs_item = $provider->getSingleCustomItem($s);
98 if ($this->parent_identification && $this->gs_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
99 global $DIC;
100 $this->gs_item = $this->gs_item->withParent($DIC->globalScreen()->identification()->fromSerializedIdentification($this->parent_identification));
101 }
102
103 $this->identification = $this->gs_item->getProviderIdentification();
104
105 $this->mm_item = new ilMMItemStorage();
106 $this->mm_item->setPosition(9999999); // always the last on the top item
107 $this->mm_item->setIdentification($this->gs_item->getProviderIdentification()->serialize());
108 $this->mm_item->setParentIdentification($this->parent_identification);
109 $this->mm_item->setActive($this->active_status);
110 if ($this->gs_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
111 $this->mm_item->setParentIdentification($this->gs_item->getParent()->serialize());
112 }
113
114 parent::create();
115 }
116
117
118 public function isAvailable() : bool
119 {
120 return false;
121 }
122
123
127 public function isAlwaysAvailable() : bool
128 {
129 return false;
130 }
131
132
136 public function getProviderNameForPresentation() : string
137 {
138 return $this->identification->getProviderNameForPresentation();
139 }
140}
An exception for terminatinating execution or to throw for unit testing.
Class ilMMCustomItemFacade.
Class ilMMCustomItemStorage.
Class ilMMCustomProvider.
Class ilMMItemStorage.
Class ilMMNullItemFacade.
__construct(IdentificationInterface $identification, Main $collector)
@inheritDoc
setIsTopItm(bool $top_item)
@inheritDoc
setActiveStatus(bool $status)
@inheritDoc
setParent(string $parent)
@inheritDoc
getProviderNameForPresentation()
@inheritDoc
Interface ilMMItemFacadeInterface.
Class BaseForm.
$s
Definition: pwgen.php:45
global $DIC
Definition: saml.php:7