ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
Alphanumeric.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
24
namespace
ILIAS\Data
;
25
26
use
ILIAS\Refinery\ConstraintViolationException
;
27
28
class
Alphanumeric
29
{
33
private
$value
;
34
39
public
function
__construct
(
$value
)
40
{
41
$matches =
null
;
42
if
(!preg_match(
'/^[a-zA-Z0-9]+$/'
, (
string
)
$value
, $matches)) {
43
throw
new
ConstraintViolationException
(
44
sprintf(
'The value "%s" is not an alphanumeric value.'
, $value),
45
'exception_not_alphanumeric'
,
46
array($value)
47
);
48
}
49
50
$this->value =
$value
;
51
}
52
56
public
function
getValue
()
57
{
58
return
$this->value
;
59
}
60
61
public
function
asString
(): string
62
{
63
return
(
string
)
$this->value
;
64
}
65
}
ILIAS\Data\Alphanumeric\$value
$value
Definition:
Alphanumeric.php:33
ILIAS\Data\Alphanumeric\getValue
getValue()
Definition:
Alphanumeric.php:56
ILIAS\Data\Alphanumeric
Definition:
Alphanumeric.php:28
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:29
ILIAS\Data\Alphanumeric\__construct
__construct($value)
Definition:
Alphanumeric.php:39
ILIAS\Data\Alphanumeric\asString
asString()
Definition:
Alphanumeric.php:61
ConstraintViolationException
ILIAS\Data
Definition:
Alphanumeric.php:24
components
ILIAS
Data
src
Alphanumeric.php
Generated on Sun Aug 31 2025 23:02:44 for ILIAS by
1.8.13 (using
Doxyfile
)