ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
22 namespace ILIAS\GlobalScreen;
23 
34 
39 class Services
40 {
41  use SingletonTrait;
42 
43  private static ?Services $instance = null;
44 
47 
48  public string $resource_version = '';
49 
55  public function __construct(
56  ProviderFactory $provider_factory,
57  ?UIServices $ui = null,
58  string $resource_version = ''
59  ) {
60  global $DIC;
61  $this->provider_factory = $provider_factory;
62  $this->resource_version = urlencode($resource_version);
63  $this->toast_services = new ToastServices($ui ?? $DIC->ui());
64  }
65 
70  public function mainBar(): MainMenuItemFactory
71  {
72  return $this->get(MainMenuItemFactory::class);
73  }
74 
78  public function metaBar(): MetaBarItemFactory
79  {
80  return $this->get(MetaBarItemFactory::class);
81  }
82 
87  public function tool(): ToolServices
88  {
89  return $this->get(ToolServices::class);
90  }
91 
95  public function layout(): LayoutServices
96  {
97  return $this->getWithArgument(LayoutServices::class, $this->resource_version);
98  }
99 
104  {
105  return $this->get(NotificationServices::class);
106  }
107 
108  public function toasts(): ToastServices
109  {
110  return $this->toast_services;
111  }
112 
116  public function collector(): CollectorFactory
117  {
118  return $this->getWithArgument(CollectorFactory::class, $this->provider_factory);
119  }
120 
126  {
127  return $this->getWithArgument(IdentificationFactory::class, $this->provider_factory);
128  }
129 }
PhpIncompatibleReturnTypeInspection
Class MetaBarItemFactory This factory provides you all available types for MainMenu GlobalScreen Item...
static Services $instance
Definition: Services.php:43
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
ProviderFactory $provider_factory
Definition: Services.php:45
Provides fluid interface to RBAC services.
Definition: UIServices.php:23
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
__construct(ProviderFactory $provider_factory, ?UIServices $ui=null, string $resource_version='')
Services constructor.
Definition: Services.php:55
trait SingletonTrait
Class SingletonTrait.
ToastServices $toast_services
Definition: Services.php:46
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
getWithArgument(string $class_name, $argument)