1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
entityerrorcollection.php
См. документацию.
1<?
2
3namespace Bitrix\UI\EntitySelector;
4
5use Traversable;
6
7class EntityErrorCollection implements \IteratorAggregate, \JsonSerializable
8{
10 protected array $errors = [];
11
12 public function add(EntityError $error): void
13 {
14 $this->errors[] = $error;
15 }
16
17 public function count(): int
18 {
19 return count($this->errors);
20 }
21
22 public function getErrors(): array
23 {
24 return $this->errors;
25 }
26
27 public function getEntityErrors(string $entityId): array
28 {
29 $entityErrors = [];
30 foreach ($this->errors as $error)
31 {
32 if ($error->getEntityId() === $entityId)
33 {
34 $entityErrors[] = $error;
35 }
36 }
37
38 return $entityErrors;
39 }
40
41 public function getErrorByCode($code): ?EntityError
42 {
43 foreach ($this->errors as $error)
44 {
45 if ($error->getCode() === $code)
46 {
47 return $error;
48 }
49 }
50
51 return null;
52 }
53
54 public function jsonSerialize(): array
55 {
56 return $this->getErrors();
57 }
58
59 public function getIterator(): Traversable
60 {
61 return new \ArrayIterator($this->errors);
62 }
63}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$entityId
Определения payment.php:4
$error
Определения subscription_card_product.php:20