ILIAS  release_8 Revision v8.24
ILIAS\Data\Alphanumeric Class Reference
+ Collaboration diagram for ILIAS\Data\Alphanumeric:

Public Member Functions

 __construct ($value)
 
 getValue ()
 
 asString ()
 

Private Attributes

 $value
 

Detailed Description

Definition at line 15 of file Alphanumeric.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Data\Alphanumeric::__construct (   $value)
Parameters
mixed$value
Exceptions
ConstraintViolationException

Definition at line 26 of file Alphanumeric.php.

27 {
28 $matches = null;
29 if (!preg_match('/^[a-zA-Z0-9]+$/', (string) $value, $matches)) {
30 throw new ConstraintViolationException(
31 sprintf('The value "%s" is not an alphanumeric value.', $value),
32 'exception_not_alphanumeric',
33 array($value)
34 );
35 }
36
37 $this->value = $value;
38 }

References ILIAS\Data\Alphanumeric\$value.

Member Function Documentation

◆ asString()

ILIAS\Data\Alphanumeric::asString ( )

Definition at line 48 of file Alphanumeric.php.

48 : string
49 {
50 return (string) $this->value;
51 }

References ILIAS\Data\Alphanumeric\$value.

◆ getValue()

ILIAS\Data\Alphanumeric::getValue ( )
Returns
mixed

Definition at line 43 of file Alphanumeric.php.

44 {
45 return $this->value;
46 }

References ILIAS\Data\Alphanumeric\$value.

Field Documentation

◆ $value

ILIAS\Data\Alphanumeric::$value
private

The documentation for this class was generated from the following file: