ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
HasMaxLength.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 2017 Jesús López <lopez@leifos.com> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Validation\Constraints
;
5
6
use
ILIAS\Validation\Constraint
;
7
use
ILIAS\Data
;
8
9
class
HasMaxLength
extends
Custom
implements
Constraint
10
{
14
protected
$max_length
;
15
16
public
function
__construct
(
int
$max_length
, Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
17
{
18
$this->max_length =
$max_length
;
19
parent::__construct(
20
function
($value) {
21
return
strlen($value) <=
$this->max_length
;
22
},
23
function
(
$txt
, $value) {
24
return
$txt
(
"not_max_length"
, $this->max_length);
25
},
26
$data_factory
,
27
$lng
28
);
29
}
30
}
ILIAS\Validation\Constraints\HasMaxLength\$max_length
$max_length
Definition:
HasMaxLength.php:14
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
ILIAS\Validation\Constraints\Custom\$lng
$lng
Definition:
Custom.php:20
Constraint
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
$txt
$txt
Definition:
error.php:11
ILIAS\Validation\Constraints\HasMaxLength\__construct
__construct(int $max_length, Data\Factory $data_factory, \ilLanguage $lng)
Definition:
HasMaxLength.php:16
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
ILIAS\Validation\Constraints\HasMaxLength
Definition:
HasMaxLength.php:9
ILIAS\Validation\Constraints\Custom\$data_factory
$data_factory
Definition:
Custom.php:15
ilLanguage
language handling
Definition:
class.ilLanguage.php:26
php
ILIAS\Data
Definition:
ClientId.php:4
src
Validation
Constraints
HasMaxLength.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)