ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
22 namespace ILIAS\GlobalScreen;
23 
35 
40 class Services
41 {
42  use SingletonTrait;
43 
44  private static ?Services $instance = null;
46 
47  public string $resource_version = '';
48 
54  public function __construct(
55  private ProviderFactory $provider_factory,
56  ?UIServices $ui = null,
57  string $resource_version = ''
58  ) {
59  global $DIC;
60  $this->resource_version = urlencode($resource_version);
61  $this->toast_services = new ToastServices($ui ?? $DIC->ui());
62  }
63 
64  public function mainBar(): MainMenuItemFactory
65  {
66  return $this->get(MainMenuItemFactory::class);
67  }
68 
69 
70  public function metaBar(): MetaBarItemFactory
71  {
72  return $this->get(MetaBarItemFactory::class);
73  }
74 
75  public function footer(): FooterItemFactory
76  {
77  return $this->get(FooterItemFactory::class);
78  }
79 
84  public function tool(): ToolServices
85  {
86  return $this->get(ToolServices::class);
87  }
88 
92  public function layout(): LayoutServices
93  {
94  return $this->getWithArgument(LayoutServices::class, $this->resource_version);
95  }
96 
101  {
102  return $this->get(NotificationServices::class);
103  }
104 
105  public function toasts(): ToastServices
106  {
107  return $this->toast_services;
108  }
109 
113  public function collector(): CollectorFactory
114  {
115  return $this->getWithArgument(CollectorFactory::class, $this->provider_factory);
116  }
117 
123  {
124  return $this->getWithArgument(IdentificationFactory::class, $this->provider_factory);
125  }
126 }
PhpIncompatibleReturnTypeInspection
Class MetaBarItemFactory This factory provides you all available types for MainMenu GlobalScreen Item...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static Services $instance
Definition: Services.php:44
trait SingletonTrait
Class SingletonTrait.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
global $DIC
Definition: shib_login.php:22
__construct(private ProviderFactory $provider_factory, ?UIServices $ui=null, string $resource_version='')
Services constructor.
Definition: Services.php:54
ToastServices $toast_services
Definition: Services.php:45
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
getWithArgument(string $class_name, $argument)