ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 28 of file Alphanumeric.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 39 of file Alphanumeric.php.

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 }

References ILIAS\Data\Alphanumeric\$value.

Member Function Documentation

◆ asString()

ILIAS\Data\Alphanumeric::asString ( )

Definition at line 61 of file Alphanumeric.php.

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

References ILIAS\Data\Alphanumeric\$value.

◆ getValue()

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

Definition at line 56 of file Alphanumeric.php.

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

References ILIAS\Data\Alphanumeric\$value.

Field Documentation

◆ $value

ILIAS\Data\Alphanumeric::$value
private

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