19declare(strict_types=1);
64 $this->db =
$DIC->database();
65 $this->main_collector =
$DIC->globalScreen()->collector()->mainmenu();
66 $this->main_collector->collectOnce();
67 $this->services =
$DIC->globalScreen();
69 foreach ($this->main_collector->getRawUnfilteredItems() as $top_item) {
76 $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);
112 return ilMMItemStorage::where(
" parent_identification = '' OR parent_identification IS NULL ")->orderBy(
'position')->getArray();
120 $r = $this->db->query(
121 "SELECT sub_items.*, top_items.position AS parent_position
122FROM il_mm_items AS sub_items
123LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
124WHERE sub_items.parent_identification != '' ORDER BY top_items.position, parent_identification, sub_items.position ASC"
127 while (
$data = $this->db->fetchAssoc($r)) {
137 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
138 if (Lost::class === $item_facade->getType()) {
139 $item_facade->delete();
144 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
145 if (Lost::class === $item_facade->getType()) {
146 $item_facade->delete();
154 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
155 if (Lost::class === $item_facade->getType()) {
161 $item_facade = $this->
getItemFacade($this->services->identification()->fromSerializedIdentification($item[
'identification']));
162 if (Lost::class === $item_facade->getType()) {
179 if ($identification->getClassName() === CustomMainBarProvider::class) {
183 return new ilMMItemFacade($identification, $this->main_collector);
193 $id = $this->services->
identification()->fromSerializedIdentification($identification);
201 if ($parents ===
null) {
204 $identification = $this->services->identification()->fromSerializedIdentification($top_item_identification);
207 $parents[$top_item_identification] = $this->
getItemFacade($identification)
222 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
223 if ($information->isCreationPrevented()) {
226 if ($information->isChild()) {
227 if ($information->getType() === TopLinkItem::class) {
230 $types[$information->getType()] = $information;
243 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
244 if (!$new || $information->isTop()) {
245 $types[$information->getType()] = $information;
261 return $this->main_collector->getTypeHandlerForItem($item);
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
Class NullIdentification.
Class NullPluginIdentification.
Class CustomMainBarProvider.
static getInstance($component)
Class ilMMCustomItemFacade.
Class ilMMItemRepository.
getPossibleSubItemTypesWithInformation()
__construct()
ilMMItemRepository constructor.
resolveIdentificationFromString(string $identification_string)
updateItem(ilMMItemFacadeInterface $item_facade)
deleteItem(ilMMItemFacadeInterface $item_facade)
getPossibleParentsForFormAndTable()
getItemFacadeForIdentificationString(string $identification)
createItem(ilMMItemFacadeInterface $item_facade)
getItemFacade(IdentificationInterface $identification=null)
getSingleItem(IdentificationInterface $identification)
getPossibleTopItemTypesWithInformation(bool $new)
getTypeHandlerForType(string $type)
getSingleItemFromFilter(IdentificationInterface $identification)
static register(isItem $item)
Class ilMMNullItemFacade.
Interface IdentificationInterface.
Interface ilMMItemFacadeInterface.