ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References ILIAS\Data\Alphanumeric\$value.

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  }

Member Function Documentation

◆ asString()

ILIAS\Data\Alphanumeric::asString ( )

Definition at line 48 of file Alphanumeric.php.

References ILIAS\Data\Alphanumeric\$value.

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

◆ getValue()

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

Definition at line 43 of file Alphanumeric.php.

References ILIAS\Data\Alphanumeric\$value.

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

Field Documentation

◆ $value

ILIAS\Data\Alphanumeric::$value
private

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