ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
AbstractIdentification.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 use LogicException;
25 
31 {
39  public function __construct(protected string $internal_identifier, protected string $classname, protected SerializerInterface $serializer, protected string $provider_presentation_name)
40  {
41  }
42 
46  public function serialize()
47  {
48  return $this->serializer->serialize($this);
49  }
50 
54  public function unserialize($serialized)
55  {
56  throw new LogicException("Please use the identification factory to unserialize");
57  }
58 
62  public function getClassName(): string
63  {
64  return $this->classname;
65  }
66 
70  public function getInternalIdentifier(): string
71  {
72  return $this->internal_identifier;
73  }
74 
78  public function getProviderNameForPresentation(): string
79  {
80  global $DIC;
84  $provider = new $this->classname($DIC);
85 
86  return $provider->getProviderNameForPresentation();
87  }
88 
89  public function __serialize(): array
90  {
91  return ['data' => $this->serialize()];
92  }
93 
94  public function __unserialize(array $data): void
95  {
96  $this->unserialize($data['data']);
97  }
98 }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
__construct(protected string $internal_identifier, protected string $classname, protected SerializerInterface $serializer, protected string $provider_presentation_name)
CoreIdentification constructor.