ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 29 of file Alphanumeric.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 40 of file Alphanumeric.php.

41 {
42 $matches = null;
43 if (!preg_match('/^[a-zA-Z0-9]+$/', (string) $value, $matches)) {
44 throw new ConstraintViolationException(
45 sprintf('The value "%s" is not an alphanumeric value.', $value),
46 'exception_not_alphanumeric',
47 array($value)
48 );
49 }
50
51 $this->value = $value;
52 }

References ILIAS\Data\Alphanumeric\$value.

Member Function Documentation

◆ asString()

ILIAS\Data\Alphanumeric::asString ( )

Definition at line 62 of file Alphanumeric.php.

62 : string
63 {
64 return (string) $this->value;
65 }

References ILIAS\Data\Alphanumeric\$value.

◆ getValue()

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

Definition at line 57 of file Alphanumeric.php.

58 {
59 return $this->value;
60 }

References ILIAS\Data\Alphanumeric\$value.

Field Documentation

◆ $value

ILIAS\Data\Alphanumeric::$value
private

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