ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
RamseyUuidWrapper.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Data\UUID;
22 
23 use Ramsey\Uuid\UuidInterface as RamseyUuidInterface;
24 
31 class 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  {
42  return $this->wrapped_uuid;
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 }
compareTo(Uuid $other)
Compares this UUID to the specified UUID.
equals(Uuid $other)
Compares this object to the specified object.
__construct(RamseyUuidInterface $wrapped_uuid)
toString()
Converts this UUID into a string representation.
__toString()
Enforce that UUID implementation implement the __toString() magic method.