ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Data\PositiveInteger Class Reference
+ Collaboration diagram for ILIAS\Data\PositiveInteger:

Public Member Functions

 __construct (int $value)
 
 getValue ()
 

Private Attributes

 $value
 

Detailed Description

Definition at line 13 of file PositiveInteger.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 24 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

25  {
26  $matches = null;
27 
28  if ($value < 0) {
29  throw new ConstraintViolationException(
30  sprintf('The value "%s" is not a positive integer', $value),
31  'exception_not_positive_integer',
32  array($value)
33  );
34  }
35 
36  $this->value = $value;
37  }

Member Function Documentation

◆ getValue()

ILIAS\Data\PositiveInteger::getValue ( )
Returns
int

Definition at line 42 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

42  : int
43  {
44  return (int) $this->value;
45  }

Field Documentation

◆ $value

ILIAS\Data\PositiveInteger::$value
private

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