ILIAS  release_7 Revision v7.30-3-g800a261c036
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 14 of file Alphanumeric.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 25 of file Alphanumeric.php.

References ILIAS\Data\Alphanumeric\$value.

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

Member Function Documentation

◆ asString()

ILIAS\Data\Alphanumeric::asString ( )
Returns
string

Definition at line 50 of file Alphanumeric.php.

References ILIAS\Data\Alphanumeric\$value.

50  : string
51  {
52  return (string) $this->value;
53  }

◆ getValue()

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

Definition at line 42 of file Alphanumeric.php.

References ILIAS\Data\Alphanumeric\$value.

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

Field Documentation

◆ $value

ILIAS\Data\Alphanumeric::$value
private

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