ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractIdentification.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use 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}
__construct(protected string $internal_identifier, protected string $classname, protected SerializerInterface $serializer, protected string $provider_presentation_name)
CoreIdentification constructor.
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:26