ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
CollectorFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
22 
31 use Throwable;
32 
38 {
39  use SingletonTrait;
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,
73  new MainMenuItemFactory(),
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 }
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
getWithMultipleArguments(string $class_name, array $arguments)
has(string $class_name)
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
trait SingletonTrait
Class SingletonTrait.
PhpIncompatibleReturnTypeInspection
getWithArgument(string $class_name, $argument)
__construct(ProviderFactory $provider_factory)
CollectorFactory constructor.