1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ValidatableElements.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
7use ArrayAccess;
8use Attribute;
14
15#[Attribute(Attribute::TARGET_PROPERTY)]
17{
19 {
21 if (!is_array($propertyValue) && !is_iterable($propertyValue) && !($propertyValue instanceof ArrayAccess))
22 {
23 $result->addError(
25 Loc::getMessage('SOCIALNETWORK_COLLAB_VALIDATOR_VALIDATABLE_ELEMENTS_INVALID_TYPE'),
26 ),
27 );
28
29 return $result;
30 }
31
32 $validationService = ServiceLocator::getInstance()->get('main.validation.service');
33 foreach ($propertyValue as $item)
34 {
35 if (!is_object($item))
36 {
37 $result->addError(
39 Loc::getMessage('SOCIALNETWORK_COLLAB_VALIDATOR_VALIDATABLE_ELEMENTS_INVALID_VALUE'),
40 ),
41 );
42
43 return $result;
44 }
45
46 $validateElementResult = $validationService->validate($item);
47
48 if (!$validateElementResult->isSuccess())
49 {
50 $result->addErrors($validateElementResult->getErrors());
51
52 return $result;
53 }
54 }
55
56 return $result;
57 }
58}
</td ></tr ></table ></td ></tr ><?endif?><? $propertyIndex=0;foreach( $arGlobalProperties as $propertyCode=> $propertyValue
Определения file_new.php:729
$result
Определения get_property_values.php:14