ILIAS  release_7 Revision v7.30-3-g800a261c036
LessThan.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
7use ILIAS\Data;
8use ILIAS\Refinery\Custom\Constraint as CustomConstraint;
9
10class LessThan extends CustomConstraint implements Constraint
11{
15 protected $max;
16
17 public function __construct(int $max, Data\Factory $data_factory, \ilLanguage $lng)
18 {
19 $this->max = $max;
21 function ($value) {
22 return $value < $this->max;
23 },
24 function ($txt, $value) {
25 return $txt("not_less_than", $value, $this->max);
26 },
28 $lng
29 );
30 }
31}
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:20
__construct(int $max, Data\Factory $data_factory, \ilLanguage $lng)
Definition: LessThan.php:17
language handling
$txt
Definition: error.php:13
A constraint encodes some resrtictions on values.
Definition: Constraint.php:15
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc