19declare(strict_types=1);
57 $this->cache =
$DIC->globalCache()->get($this);
58 $this->db =
$DIC->database();
59 $this->main_collector =
$DIC->globalScreen()->collector()->mainmenu();
60 $this->main_collector->collectOnce();
61 $this->services =
$DIC->globalScreen();
63 foreach ($this->main_collector->getRawUnfilteredItems() as $top_item) {
80 $this->cache->flush();
85 return $this->main_collector->getSingleItemFromRaw($identification);
90 return $this->main_collector->getSingleItemFromFilter($identification);
95 return $this->services->identification()->fromSerializedIdentification($identification_string);
115 if ($parent !==
null) {
116 $r = $this->db->queryF(
117 "SELECT sub_items.*, top_items.position AS parent_position
118FROM il_mm_items AS sub_items
119LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
120WHERE sub_items.parent_identification != '' AND sub_items.parent_identification = %s
121ORDER BY top_items.position, parent_identification, sub_items.position ASC",
123 [$parent->identification()->serialize()]
126 $r = $this->db->query(
127 "SELECT sub_items.*, top_items.position AS parent_position
128FROM il_mm_items AS sub_items
129LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
130WHERE sub_items.parent_identification != ''
131ORDER BY top_items.position, parent_identification, sub_items.position ASC",
135 while (
$data = $this->db->fetchAssoc($r)) {
146 $this->services->identification()->fromSerializedIdentification($item[
'identification'])
148 if (Lost::class === $item_facade->getType()) {
149 $item_facade->delete();
155 $this->services->identification()->fromSerializedIdentification($item[
'identification'])
157 if (Lost::class === $item_facade->getType()) {
158 $item_facade->delete();
167 $this->services->identification()->fromSerializedIdentification($item[
'identification'])
169 if (Lost::class === $item_facade->getType()) {
176 $this->services->identification()->fromSerializedIdentification($item[
'identification'])
178 if (Lost::class === $item_facade->getType()) {
193 if ($identification->getClassName() === CustomMainBarProvider::class) {
197 return new ilMMItemFacade($identification, $this->main_collector);
203 foreach ($identifications as $identification) {
204 $id = $this->services->identification()->fromSerializedIdentification($identification);
208 return $item_facades;
216 $id = $this->services->identification()->fromSerializedIdentification($identification);
224 if ($parents ===
null) {
226 foreach (array_keys($this->
getTopItems()) as $top_item_identification) {
227 $identification = $this->services->identification()->fromSerializedIdentification(
228 $top_item_identification
232 $parents[$top_item_identification] = $this->
getItemFacade($identification)
247 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
248 if ($information->isCreationPrevented()) {
251 if ($information->isChild()) {
253 if ($information->getType() === TopLinkItem::class) {
256 $types[$information->getType()] = $information;
269 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
270 if (!$new || $information->isTop()) {
271 $types[$information->getType()] = $information;
285 return $this->main_collector->getTypeHandlerForItem($item);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static where($where, $operator=null)
Class NullIdentification.
Class NullPluginIdentification.
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
Class CustomMainBarProvider.
Class ilMMCustomItemFacade.
getSubItemsForTable(?ilMMItemFacadeInterface $parent=null)
getPossibleSubItemTypesWithInformation()
__construct()
ilMMItemRepository constructor.
resolveIdentificationFromString(string $identification_string)
updateItem(ilMMItemFacadeInterface $item_facade)
deleteItem(ilMMItemFacadeInterface $item_facade)
getItemFacadesForIdentificationStrings(array $identifications)
getPossibleParentsForFormAndTable()
getItemFacadeForIdentificationString(string $identification)
createItem(ilMMItemFacadeInterface $item_facade)
getItemFacade(?IdentificationInterface $identification=null)
getSingleItem(IdentificationInterface $identification)
getPossibleTopItemTypesWithInformation(bool $new)
getTypeHandlerForType(string $type)
MainMenuMainCollector $main_collector
getSingleItemFromFilter(IdentificationInterface $identification)
static register(isItem $item)
Class ilMMNullItemFacade.
Interface IdentificationInterface.
Interface ilMMItemFacadeInterface.