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
23use Serializable;
24
32abstract class AbstractIdentification implements Serializable, \Stringable
33{
34 final public function __construct(private string $unique_id)
35 {
36 }
37
38
39 final public function serialize(): string
40 {
41 return $this->unique_id;
42 }
43
44
45 final public function unserialize($serialized): void
46 {
47 $this->unique_id = $serialized;
48 }
49
53 final public function __serialize(): array
54 {
55 return [
56 'unique_id' => $this->unique_id
57 ];
58 }
59
60 final public function __unserialize(array $data): void
61 {
62 $this->unique_id = $data['unique_id'];
63 }
64
65
66 final public function __toString(): string
67 {
68 return $this->serialize();
69 }
70}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...