Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
datevalidator.php
1
<?php
9
namespace
Bitrix\Main\ORM\Fields\Validators
;
10
11
use
Bitrix\Main\ORM
;
12
use
Bitrix\Main\Type
;
13
14
class
DateValidator
extends
Validator
15
{
16
public
function
validate
($value, $primary, array $row, ORM\Fields\
Field
$field)
17
{
18
if
(empty($value))
19
{
20
return
true
;
21
}
22
23
if
($value instanceof
Type
\
Date
)
24
{
25
// self-validating object
26
return
true
;
27
}
28
29
return
$this->
getErrorMessage
($value, $field);
30
}
31
}
Bitrix\Main\ORM\Fields\Field
Definition
field.php:25
Bitrix\Main\ORM\Fields\Validators\DateValidator
Definition
datevalidator.php:15
Bitrix\Main\ORM\Fields\Validators\DateValidator\validate
validate($value, $primary, array $row, ORM\Fields\Field $field)
Definition
datevalidator.php:16
Bitrix\Main\ORM\Fields\Validators\Validator
Definition
validator.php:18
Bitrix\Main\ORM\Fields\Validators\Validator\getErrorMessage
getErrorMessage($value, ORM\Fields\Field $field, $errorPhrase=null, $additionalTemplates=null)
Definition
validator.php:50
Bitrix\Main\Type\Date
Definition
date.php:9
Bitrix\Main\ORM\Fields\Validators
Definition
booleanvalidator.php:9
Bitrix\Main\ORM
Bitrix\Main\Type
Definition
collection.php:2
modules
main
lib
orm
fields
validators
datevalidator.php
Создано системой
1.10.0