ILIAS  release_7 Revision v7.30-3-g800a261c036
CollectorFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
22
31use Throwable;
32
38{
40
44 protected static $instances = [];
49
55 {
56 $this->provider_factory = $provider_factory;
57 }
58
63 public function mainmenu() : MainMenuMainCollector
64 {
65 if (!$this->has(MainMenuMainCollector::class)) {
66 $providers = $this->provider_factory->getMainBarProvider();
67 $information = $this->provider_factory->getMainBarItemInformation();
68
69 return $this->getWithMultipleArguments(
70 MainMenuMainCollector::class,
71 [
72 $providers,
74 $information
75 ]
76 );
77 }
78
79 return $this->get(MainMenuMainCollector::class);
80 }
81
82 public function metaBar() : MetaBarMainCollector
83 {
84 return $this->getWithArgument(MetaBarMainCollector::class, $this->provider_factory->getMetaBarProvider());
85 }
86
87 public function tool() : MainToolCollector
88 {
89 if (!$this->has(MainToolCollector::class)) {
90 $providers = $this->provider_factory->getToolProvider();
91 $information = $this->provider_factory->getMainBarItemInformation();
92
93 return $this->getWithMultipleArguments(MainToolCollector::class, [$providers, $information]);
94 }
95
96 return $this->get(MainToolCollector::class);
97 }
98
99 public function layout() : MainLayoutCollector
100 {
101 return $this->getWithMultipleArguments(MainLayoutCollector::class, [$this->provider_factory->getModificationProvider()]);
102 }
103
105 {
106 return $this->getWithArgument(MainNotificationCollector::class, $this->provider_factory->getNotificationsProvider());
107 }
108}
An exception for terminatinating execution or to throw for unit testing.
__construct(ProviderFactory $provider_factory)
CollectorFactory constructor.
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
@noinspection PhpIncompatibleReturnTypeInspection
trait SingletonTrait
Class SingletonTrait.
has(string $class_name)
getWithArgument(string $class_name, $argument)
getWithMultipleArguments(string $class_name, array $arguments)