ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NotEmptyConstraint.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Repository\Form;
22
23use ILIAS\Data;
25use ilLanguage;
26
27class NotEmpty extends Constraint
28{
29 public function __construct(Data\Factory $data_factory, ilLanguage $lng)
30 {
31 $lng->loadLanguageModule("rep");
33 static function ($value): bool {
34 return trim($value) !== '';
35 },
36 static function ($txt, $value): string {
37 return $txt("rep_input_not_empty");
38 },
39 $data_factory,
40 $lng
41 );
42 }
43}
Builds data types.
Definition: Factory.php:36
__construct(Data\Factory $data_factory, ilLanguage $lng)
language handling
$txt
Definition: error.php:31
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:31