ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 28 of file PositiveInteger.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 35 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

36  {
37  if ($value < 0) {
38  throw new ConstraintViolationException(
39  sprintf('The value "%s" is not a positive integer', $value),
40  'exception_not_positive_integer',
41  array($value)
42  );
43  }
44 
45  $this->value = $value;
46  }

Member Function Documentation

◆ getValue()

ILIAS\Data\PositiveInteger::getValue ( )

Definition at line 48 of file PositiveInteger.php.

References ILIAS\Data\PositiveInteger\$value.

48  : int
49  {
50  return $this->value;
51  }

Field Documentation

◆ $value

int ILIAS\Data\PositiveInteger::$value
private

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