ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Identification\Serializer\SerializerInterface
 serialize (IdentificationInterface $identification)
 The string MUST be shorter than 64 characters. More...
 

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)

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.

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

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  }
+ 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: