Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
EqualsValidator.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
15
class
EqualsValidator
extends
ValidatorHasNotNull
{
16
protected
$ref
;
17
18
public
function
__construct
() {
19
$this->message =
'This value should be equals to `{ref}`'
;
20
}
21
22
public
function
validate
(
$value
) {
23
parent::validate (
$value
);
24
if
($this->notNull !==
false
) {
25
return
$value
==
$this->ref
;
26
}
27
return
true
;
28
}
29
35
public
function
getParameters
(): array {
36
return [
'ref'
,
'value'
];
37
}
38
44
public
function
asUI
(): array {
45
return \array_merge_recursive ( parent::asUI (), [
'rules'
=> [ [
'type'
=>
'is'
,
'prompt'
=> $this->_getMessage (),
'value'
=> $this->ref ] ] ] );
46
}
47
}
48
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\EqualsValidator
Ubiquity\contents\validation\validators\comparison$EqualsValidator This class is part of Ubiquity.
Definition
EqualsValidator.php:15
Ubiquity\contents\validation\validators\comparison\EqualsValidator\getParameters
getParameters()
{{}\Ubiquity\contents\validation\validators\ValidatorInterfacegetParameters()}
Definition
EqualsValidator.php:35
Ubiquity\contents\validation\validators\comparison\EqualsValidator\__construct
__construct()
Definition
EqualsValidator.php:18
Ubiquity\contents\validation\validators\comparison\EqualsValidator\validate
validate($value)
Definition
EqualsValidator.php:22
Ubiquity\contents\validation\validators\comparison\EqualsValidator\asUI
asUI()
{}
Definition
EqualsValidator.php:44
Ubiquity\contents\validation\validators\comparison\EqualsValidator\$ref
$ref
Definition
EqualsValidator.php:16
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
EqualsValidator.php
Generated on Sun Dec 10 2023 15:04:14 for
Ubiquity
by
doxygen
1.9.8