ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SerializerFactory.php
Go to the documentation of this file.
1
<?
php
namespace
ILIAS\GlobalScreen\Identification\Serializer
;
2
8
class
SerializerFactory
9
{
10
14
private
static
$core_instance
;
18
private
static
$plugin_instance
;
19
20
24
public
function
core
() :
SerializerInterface
25
{
26
if
(!isset(self::$core_instance)) {
27
self::$core_instance =
new
CoreSerializer
();
28
}
29
30
return
self::$core_instance;
31
}
32
33
37
public
function
plugin
() :
SerializerInterface
38
{
39
if
(!isset(self::$plugin_instance)) {
40
self::$plugin_instance =
new
PluginSerializer
();
41
}
42
43
return
self::$plugin_instance;
44
}
45
46
52
public
function
fromSerializedIdentification
(
string
$serialized_identification) :
SerializerInterface
53
{
54
$plugin = $this->
plugin
();
55
if
($plugin->canHandle($serialized_identification)) {
56
return
$plugin;
57
}
58
59
$core = $this->
core
();
60
if
($core->canHandle($serialized_identification)) {
61
return
$core;
62
}
63
64
throw
new \InvalidArgumentException(
"Nobody can handle serialized identification '$serialized_identification'."
);
65
}
66
}
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory\fromSerializedIdentification
fromSerializedIdentification(string $serialized_identification)
Definition:
SerializerFactory.php:52
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory\$core_instance
static $core_instance
Definition:
SerializerFactory.php:14
ILIAS\GlobalScreen\Identification\Serializer\CoreSerializer
Class CoreSerializer.
Definition:
CoreSerializer.php:14
ILIAS\GlobalScreen\Identification\Serializer
Definition:
CoreSerializer.php:1
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory\core
core()
Definition:
SerializerFactory.php:24
ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer
Class PluginSerializer.
Definition:
PluginSerializer.php:15
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory\plugin
plugin()
Definition:
SerializerFactory.php:37
ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface
Interface SerializerInterface.
Definition:
SerializerInterface.php:12
php
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory\$plugin_instance
static $plugin_instance
Definition:
SerializerFactory.php:18
ILIAS\GlobalScreen\Identification\Serializer\SerializerFactory
Class SerializerFactory.
Definition:
SerializerFactory.php:8
src
GlobalScreen
Identification
Serializer
SerializerFactory.php
Generated on Thu Jan 16 2025 19:02:37 for ILIAS by
1.8.13 (using
Doxyfile
)