ILIAS  release_8 Revision v8.23
IdentificationFactory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
21 
26 
48 {
52 
57  final public function __construct(ProviderFactory $provider_factory)
58  {
59  $this->serializer_factory = new SerializerFactory();
60  $this->map = new IdentificationMap();
61  $this->provider_factory = $provider_factory;
62  }
63 
69  {
70  return new CoreIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
71  }
72 
78  {
79  return new ToolIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
80  }
81 
88  final public function plugin(string $plugin_id, Provider $provider): PluginIdentificationProvider
89  {
90  return new PluginIdentificationProvider($provider, $plugin_id, $this->serializer_factory->plugin(), $this->map);
91  }
92 
97  final public function fromSerializedIdentification($serialized_string): IdentificationInterface
98  {
99  if ($serialized_string === null || $serialized_string === "") {
100  return new NullIdentification();
101  }
102  if ($this->map->isInMap($serialized_string)) {
103  return $this->map->getFromMap($serialized_string);
104  }
105 
106  return $this->serializer_factory->fromSerializedIdentification($serialized_string)->unserialize($serialized_string, $this->map, $this->provider_factory);
107  }
108 }
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.
$provider
Definition: ltitoken.php:83
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...