ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer Class Reference

Class PluginSerializer. More...

+ Inheritance diagram for ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer:
+ Collaboration diagram for ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer:

Public Member Functions

 unserialize (string $serialized_string, IdentificationMap $map, ProviderFactory $provider_factory)
 
Parameters
string$serialized_string
IdentificationMap$map
ProviderFactory$provider_factory
Returns
IdentificationInterface
More...
 
 canHandle (string $serialized_identification)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface
 serialize (IdentificationInterface $identification)
 The string MUST be shorter than 64 characters. More...
 
 unserialize (string $serialized_string, IdentificationMap $map, ProviderFactory $provider_factory)
 
 canHandle (string $serialized_identification)
 

Protected Attributes

const DIVIDER = '|'
 

Additional Inherited Members

- Data Fields inherited from ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface
const MAX_LENGTH = 255
 

Detailed Description

Member Function Documentation

◆ canHandle()

ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer::canHandle ( string  $serialized_identification)

@inheritDoc

Implements ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface.

Definition at line 76 of file PluginSerializer.php.

76 : bool
77 {
78 return preg_match('/(.*?)\|(.*?)\|(.*)/m', $serialized_identification) > 0;
79 }

◆ unserialize()

ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer::unserialize ( string  $serialized_string,
IdentificationMap  $map,
ProviderFactory  $provider_factory 
)

Parameters
string$serialized_string
IdentificationMap$map
ProviderFactory$provider_factory
Returns
IdentificationInterface

Implements ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface.

Definition at line 60 of file PluginSerializer.php.

60 : IdentificationInterface
61 {
62 [$plugin_id, $class_name, $internal_identifier] = explode(self::DIVIDER, $serialized_string);
63
64 if (!$provider_factory->isInstanceCreationPossible($class_name) || !$provider_factory->isRegistered($class_name)) {
65 return new NullPluginIdentification($plugin_id, $serialized_string, $internal_identifier);
66 }
67
68 $f = new PluginIdentificationProvider($provider_factory->getProviderByClassName($class_name), $plugin_id, $this, $map);
69
70 return $f->identifier($internal_identifier);
71 }

References Vendor\Package\$f, ILIAS\GlobalScreen\Provider\ProviderFactory\getProviderByClassName(), ILIAS\GlobalScreen\Provider\ProviderFactory\isInstanceCreationPossible(), and ILIAS\GlobalScreen\Provider\ProviderFactory\isRegistered().

+ Here is the call graph for this function:

Field Documentation

◆ DIVIDER

const ILIAS\GlobalScreen\Identification\Serializer\PluginSerializer::DIVIDER = '|'
protected

Definition at line 36 of file PluginSerializer.php.


The documentation for this class was generated from the following file: