ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
GreaterThan.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
7 use ILIAS\Data;
9 
10 class GreaterThan extends Custom implements Constraint
11 {
15  protected $min;
16 
17  public function __construct(int $min, Data\Factory $data_factory, \ilLanguage $lng)
18  {
19  $this->min = $min;
20  parent::__construct(
21  function ($value) {
22  return $value > $this->min;
23  },
24  function ($txt, $value) {
25  return $txt("not_greater_than", $value, $this->min);
26  },
28  $lng
29  );
30  }
31 }
A constraint encodes some resrtictions on values.
Definition: Constraint.php:14
__construct(int $min, Data\Factory $data_factory, \ilLanguage $lng)
Definition: GreaterThan.php:17
Builds data types.
Definition: Factory.php:14
$txt
Definition: error.php:11
language handling