ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
IdentificationFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
49{
52
57 final public function __construct(protected ProviderFactory $provider_factory)
58 {
59 $this->serializer_factory = new SerializerFactory();
60 $this->map = new IdentificationMap();
61 }
62
68 {
69 return new CoreIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
70 }
71
77 {
78 return new ToolIdentificationProvider($provider, $this->serializer_factory->core(), $this->map);
79 }
80
87 final public function plugin(string $plugin_id, Provider $provider): PluginIdentificationProvider
88 {
89 return new PluginIdentificationProvider($provider, $plugin_id, $this->serializer_factory->plugin(), $this->map);
90 }
91
96 final public function fromSerializedIdentification($serialized_string): IdentificationInterface
97 {
98 if ($serialized_string === null || $serialized_string === "") {
99 return new NullIdentification();
100 }
101 if ($this->map->isInMap($serialized_string)) {
102 return $this->map->getFromMap($serialized_string);
103 }
104
105 return $this->serializer_factory->fromSerializedIdentification($serialized_string)->unserialize($serialized_string, $this->map, $this->provider_factory);
106 }
107}
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
plugin(string $plugin_id, Provider $provider)
Returns a IdentificationProvider for ILIAS-Plugins which takes care of the plugin_id for further iden...
core(Provider $provider)
Returns a IdentificationProvider for core components, only a Provider is needed.
tool(Provider $provider)
Returns a IdentificationProvider for core tools, only a Provider is needed.
__construct(protected ProviderFactory $provider_factory)
IdentificationFactory constructor.
$provider
Definition: ltitoken.php:80