ILIAS  release_8 Revision v8.24
RamseyUuidWrapper.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5namespace ILIAS\Data\UUID;
6
7use Ramsey\Uuid\UuidInterface as RamseyUuidInterface;
8
15class RamseyUuidWrapper implements Uuid
16{
17 private RamseyUuidInterface $wrapped_uuid;
18
19 public function __construct(RamseyUuidInterface $wrapped_uuid)
20 {
21 $this->wrapped_uuid = $wrapped_uuid;
22 }
23
24 public function getWrappedUuid(): RamseyUuidInterface
25 {
27 }
28
29 public function compareTo(Uuid $other): int
30 {
31 return $this->wrapped_uuid->compareTo($other->getWrappedUuid());
32 }
33
34 public function equals(Uuid $other): bool
35 {
36 return $this->wrapped_uuid->equals($other->getWrappedUuid());
37 }
38
39 public function toString(): string
40 {
41 return $this->wrapped_uuid->toString();
42 }
43
44 public function __toString(): string
45 {
46 return $this->toString();
47 }
48}
equals(Uuid $other)
Compares this object to the specified object.
toString()
Converts this UUID into a string representation.
compareTo(Uuid $other)
Compares this UUID to the specified UUID.
__toString()
Enforce that UUID implementation implement the __toString() magic method.
__construct(RamseyUuidInterface $wrapped_uuid)