ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
IdentificationFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
21 
26 
48 {
52  protected $provider_factory;
60  protected $map;
61 
67  {
68  $this->serializer_factory = new SerializerFactory();
69  $this->map = new IdentificationMap();
70  $this->provider_factory = $provider_factory;
71  }
72 
77  final public function core(Provider $provider) : CoreIdentificationProvider
78  {
79  return new CoreIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
80  }
81 
86  final public function tool(Provider $provider) : ToolIdentificationProvider
87  {
88  return new ToolIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
89  }
90 
97  final public function plugin(string $plugin_id, Provider $provider) : PluginIdentificationProvider
98  {
99  return new PluginIdentificationProvider($provider, $plugin_id, $this->serializer_factory->plugin(), $this->map);
100  }
101 
106  final public function fromSerializedIdentification($serialized_string) : IdentificationInterface
107  {
108  if ($serialized_string === null || $serialized_string === "") {
109  return new NullIdentification();
110  }
111  if ($this->map->isInMap($serialized_string)) {
112  return $this->map->getFromMap($serialized_string);
113  }
114 
115  return $this->serializer_factory->fromSerializedIdentification($serialized_string)->unserialize($serialized_string, $this->map, $this->provider_factory);
116  }
117 }
plugin(string $plugin_id, Provider $provider)
Returns a IdentificationProvider for ILIAS-Plugins which takes care of the plugin_id for further iden...
__construct(ProviderFactory $provider_factory)
IdentificationFactory constructor.
tool(Provider $provider)
Returns a IdentificationProvider for core tools, only a Provider is needed.
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
core(Provider $provider)
Returns a IdentificationProvider for core components, only a Provider is needed.