ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CollectorFactory.php
Go to the documentation of this file.
2
6use ILIAS\GlobalScreen\Scope\MetaBar\Collector\MetaBarMainCollector;
7use ILIAS\GlobalScreen\Scope\MetaBar\Provider\StaticMetaBarProvider;
8use ILIAS\GlobalScreen\Scope\Tool\Collector\MainToolCollector;
9use ILIAS\GlobalScreen\Scope\Tool\Provider\DynamicToolProvider;
10
17{
18
22 protected static $instances = [];
27
28
35 {
36 $this->provider_factory = $provider_factory;
37 }
38
39
44 public function mainmenu() : MainMenuMainCollector
45 {
46 if (!isset(self::$instances[StaticMainMenuProvider::class])) {
47 $providers = $this->provider_factory->getMainBarProvider();
48 $information = $this->provider_factory->getMainBarItemInformation();
49 self::$instances[StaticMainMenuProvider::class] = new MainMenuMainCollector($providers, $information);
50 }
51
52 return self::$instances[StaticMainMenuProvider::class];
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
__construct(ProviderFactoryInterface $provider_factory)
CollectorFactory constructor.