ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CollectorFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
23
33use Throwable;
35
42{
44
45 protected static array $instances = [];
46
51 public function __construct(private ProviderFactory $provider_factory)
52 {
53 }
54
60 {
61 if (!$this->has(MainMenuMainCollector::class)) {
62 $providers = $this->provider_factory->getMainBarProvider();
63 $information = $this->provider_factory->getMainBarItemInformation();
64
65 return $this->getWithMultipleArguments(
66 MainMenuMainCollector::class,
67 [
68 $providers,
70 $information
71 ]
72 );
73 }
74
75 return $this->get(MainMenuMainCollector::class);
76 }
77
78 public function metaBar(): MetaBarMainCollector
79 {
80 return $this->getWithArgument(MetaBarMainCollector::class, $this->provider_factory->getMetaBarProvider());
81 }
82 public function footer(): FooterMainCollector
83 {
84 if (!$this->has(FooterMainCollector::class)) {
85 $providers = $this->provider_factory->getFooterProvider();
86 $information = $this->provider_factory->getFooterItemInformation();
87
88 return $this->getWithMultipleArguments(
89 FooterMainCollector::class,
90 [
91 $providers,
92 $information
93 ]
94 );
95 }
96
97 return $this->get(FooterMainCollector::class);
98 }
99
100 public function tool(): MainToolCollector
101 {
102 if (!$this->has(MainToolCollector::class)) {
103 $providers = $this->provider_factory->getToolProvider();
104 $information = $this->provider_factory->getMainBarItemInformation();
105
106 return $this->getWithMultipleArguments(MainToolCollector::class, [$providers, $information]);
107 }
108
109 return $this->get(MainToolCollector::class);
110 }
111
112 public function layout(): MainLayoutCollector
113 {
114 return $this->getWithMultipleArguments(MainLayoutCollector::class, [$this->provider_factory->getModificationProvider()]);
115 }
116
118 {
119 return $this->getWithArgument(MainNotificationCollector::class, $this->provider_factory->getNotificationsProvider());
120 }
121
122 public function toasts(): ToastCollector
123 {
124 return $this->getWithArgument(ToastCollector::class, $this->provider_factory->getToastsProvider());
125 }
126}
__construct(private 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...
trait SingletonTrait
Class SingletonTrait.
@noinspection PhpIncompatibleReturnTypeInspection
has(string $class_name)
getWithArgument(string $class_name, $argument)
getWithMultipleArguments(string $class_name, array $arguments)