Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
GreaterThanOrEqualValidator.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\contents\validation\validators\comparison
;
4
5
use
Ubiquity\contents\validation\validators\ValidatorHasNotNull
;
6
use Ajax\semantic\components\validation\CustomRule;
7
8
class
GreaterThanOrEqualValidator
extends
ValidatorHasNotNull
{
9
protected
$ref
;
10
11
public
function
__construct
() {
12
$this->message =
'This value should be greater or equal than `{ref}`'
;
13
}
14
15
public
function
validate
(
$value
) {
16
parent::validate (
$value
);
17
if
($this->notNull !==
false
) {
18
return
$value
>=
$this->ref
;
19
}
20
return
true
;
21
}
22
28
public
function
getParameters
(): array {
29
return [
'ref'
,
'value'
];
30
}
31
37
public
function
asUI
(): array {
38
$rule = new CustomRule (
'greaterthanoreq'
,
"function(v,gThan){ return v>=gThan;}"
, $this->_getMessage (), $this->ref );
39
return \array_merge_recursive ( parent::asUI (), [
'rules'
=> [ $rule ] ] );
40
}
41
}
42
Ubiquity\contents\validation\validators\ValidatorHasNotNull
Definition
ValidatorHasNotNull.php:8
Ubiquity\contents\validation\validators\Validator\$value
$value
Definition
Validator.php:15
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator
Definition
GreaterThanOrEqualValidator.php:8
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator\getParameters
getParameters()
{{}\Ubiquity\contents\validation\validators\ValidatorInterfacegetParameters()}
Definition
GreaterThanOrEqualValidator.php:28
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator\__construct
__construct()
Definition
GreaterThanOrEqualValidator.php:11
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator\validate
validate($value)
Definition
GreaterThanOrEqualValidator.php:15
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator\asUI
asUI()
{}
Definition
GreaterThanOrEqualValidator.php:37
Ubiquity\contents\validation\validators\comparison\GreaterThanOrEqualValidator\$ref
$ref
Definition
GreaterThanOrEqualValidator.php:9
Ubiquity\contents\validation\validators\comparison
Definition
EqualsValidator.php:3
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
contents
validation
validators
comparison
GreaterThanOrEqualValidator.php
Generated on Sun Dec 10 2023 15:04:14 for
Ubiquity
by
doxygen
1.9.8