ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace ILIAS\Data\UUID;
6 
7 use Exception;
9 
16 class Factory
17 {
18  private UuidFactory $uuid_factory;
19 
20  public function __construct()
21  {
22  $this->uuid_factory = new UuidFactory();
23  }
24 
25  public function uuid4(): Uuid
26  {
27  return new RamseyUuidWrapper($this->uuid_factory->uuid4());
28  }
29 
30  public function uuid4AsString(): string
31  {
32  return $this->uuid4()->toString();
33  }
34 
35  public function fromString(string $uuid): Uuid
36  {
37  return new RamseyUuidWrapper($this->uuid_factory->fromString($uuid));
38  }
39 }
fromString(string $uuid)
Definition: Factory.php:35
UuidFactory $uuid_factory
Definition: Factory.php:18