ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
CollectorFactory.php
Go to the documentation of this file.
1 <?php namespace ILIAS\GlobalScreen\Collector;
2 
11 
18 {
19  use SingletonTrait;
23  protected static $instances = [];
28 
29 
36  {
37  $this->provider_factory = $provider_factory;
38  }
39 
40 
45  public function mainmenu() : MainMenuMainCollector
46  {
47  if (!$this->has(MainMenuMainCollector::class)) {
48  $providers = $this->provider_factory->getMainBarProvider();
49  $information = $this->provider_factory->getMainBarItemInformation();
50 
51  return $this->getWithMultipleArguments(
52  MainMenuMainCollector::class,
53  [
54  $providers,
55  new MainMenuItemFactory(),
56  $information
57  ]
58  );
59  }
60 
61  return $this->get(MainMenuMainCollector::class);
62  }
63 
64 
68  public function metaBar() : MetaBarMainCollector
69  {
70  return $this->getWithArgument(MetaBarMainCollector::class, $this->provider_factory->getMetaBarProvider());
71  }
72 
73 
78  public function tool() : MainToolCollector
79  {
80  if (!$this->has(MainToolCollector::class)) {
81  $providers = $this->provider_factory->getToolProvider();
82  $information = $this->provider_factory->getMainBarItemInformation();
83 
84  return $this->getWithMultipleArguments(MainToolCollector::class, [$providers, $information]);
85  }
86 
87  return $this->get(MainToolCollector::class);
88  }
89 
90 
95  public function layout() : MainLayoutCollector
96  {
97  return $this->getWithMultipleArguments(MainLayoutCollector::class, [$this->provider_factory->getModificationProvider()]);
98  }
99 
100 
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)
trait SingletonTrait
Class SingletonTrait.
getWithArgument(string $class_name, $argument)
__construct(ProviderFactory $provider_factory)
CollectorFactory constructor.