ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
RamseyUuidWrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Data\UUID;
22
23use Ramsey\Uuid\UuidInterface as RamseyUuidInterface;
24
31class RamseyUuidWrapper implements Uuid
32{
33 private RamseyUuidInterface $wrapped_uuid;
34
35 public function __construct(RamseyUuidInterface $wrapped_uuid)
36 {
37 $this->wrapped_uuid = $wrapped_uuid;
38 }
39
40 public function getWrappedUuid(): RamseyUuidInterface
41 {
43 }
44
45 public function compareTo(Uuid $other): int
46 {
47 return $this->wrapped_uuid->compareTo($other->getWrappedUuid());
48 }
49
50 public function equals(Uuid $other): bool
51 {
52 return $this->wrapped_uuid->equals($other->getWrappedUuid());
53 }
54
55 public function toString(): string
56 {
57 return $this->wrapped_uuid->toString();
58 }
59
60 public function __toString(): string
61 {
62 return $this->toString();
63 }
64}
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)