ILIAS
trunk Revision v11.0_alpha-1843-g9e1fad99175
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
CertificateId.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Certificate\ValueObject
;
22
23
use
InvalidArgumentException
;
24
25
class
CertificateId
26
{
27
private
const
UUID_LENGTH
= 36;
28
private
const
UUID_SEPARATOR_COUNT
= 4;
29
30
private
readonly
string
$certificate_id
;
31
32
public
function
__construct
(
string
$certificate_id)
33
{
34
if
($certificate_id ===
''
) {
35
throw
new
InvalidArgumentException
(
'certificate_id cannot be empty.'
);
36
}
37
38
if
(strlen($certificate_id) !== self::UUID_LENGTH) {
39
throw
new
InvalidArgumentException
(sprintf(
40
'certificate_id must be a valid UUID. UUID must be %s characters long.'
,
41
self::UUID_LENGTH
42
));
43
}
44
45
if
(substr_count($certificate_id,
'-'
) !== 4) {
46
throw
new
InvalidArgumentException
(sprintf(
47
'certificate_id must be a valid UUID. UUID must contain %s "-" characters.'
,
48
self::UUID_SEPARATOR_COUNT
49
));
50
}
51
$this->certificate_id =
$certificate_id
;
52
}
53
54
public
function
asString
(): string
55
{
56
return
$this->certificate_id
;
57
}
58
}
ILIAS\Certificate\ValueObject\CertificateId\__construct
__construct(string $certificate_id)
Definition:
CertificateId.php:32
ILIAS\Certificate\ValueObject\CertificateId\$certificate_id
readonly string $certificate_id
Definition:
CertificateId.php:30
ILIAS\Certificate\ValueObject\CertificateId\asString
asString()
Definition:
CertificateId.php:54
ILIAS\Certificate\ValueObject\CertificateId
Definition:
CertificateId.php:25
ILIAS\Certificate\ValueObject
Definition:
CertificateId.php:21
ILIAS\Certificate\ValueObject\CertificateId\UUID_SEPARATOR_COUNT
const UUID_SEPARATOR_COUNT
Definition:
CertificateId.php:28
InvalidArgumentException
ILIAS\Certificate\ValueObject\CertificateId\UUID_LENGTH
const UUID_LENGTH
Definition:
CertificateId.php:27
components
ILIAS
Certificate
classes
ValueObject
CertificateId.php
Generated on Sun Apr 20 2025 23:02:48 for ILIAS by
1.8.13 (using
Doxyfile
)