ILIAS  release_8 Revision v8.19
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

int $value
 

Detailed Description

Definition at line 15 of file PositiveInteger.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 22 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

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

Member Function Documentation

◆ getValue()

ILIAS\Data\PositiveInteger::getValue ( )

Definition at line 35 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

35  : int
36  {
37  return $this->value;
38  }

Field Documentation

◆ $value

int ILIAS\Data\PositiveInteger::$value
private

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