ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
UniqueIDCollectionIdentificationGenerator.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
31
33 {
34 $unique_id = null;
35 try {
36 $unique_id = $this->factory->uuid4AsString();
37 } catch (\Exception $e) {
38 throw new \LogicException('Generating uuid failed: ' . $e->getMessage(), $e->getCode(), $e);
39 } finally {
40 return new ResourceCollectionIdentification($unique_id);
41 }
42 }
43
44 public function validateScheme(string $existing): bool
45 {
46 return preg_match('/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/', $existing) === 1;
47 }
48}
factory()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trait UUIDStringTrait
Class UniqueIDCollectionIdentificationGenerator.