ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
IsNumeric.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 2017 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see
3
docs/LICENSE */
4
5
namespace
ILIAS\Validation\Constraints
;
6
7
use
ILIAS\Validation\Constraint
;
8
use
ILIAS\Data
;
9
use
ILIAS\Data\Result
;
10
11
class
IsNumeric
extends
Custom
implements
Constraint
12
{
13
public
function
__construct
(Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
14
{
15
parent::__construct(
16
function
($value) {
17
return
is_numeric($value);
18
},
19
function
(
$txt
, $value) {
20
return
$txt
(
"not_numeric"
, $value);
21
},
22
$data_factory
,
23
$lng
24
);
25
}
26
}
ILIAS\Data\Result
Definition:
Error.php:4
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\Validation\Constraints\IsNumeric
Definition:
IsNumeric.php:11
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
$txt
$txt
Definition:
error.php:11
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
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
ILIAS\Validation\Constraints\IsNumeric\__construct
__construct(Data\Factory $data_factory, \ilLanguage $lng)
Definition:
IsNumeric.php:13
src
Validation
Constraints
IsNumeric.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)