Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
errorcollection.php
1
<?php
2
3
namespace
Bitrix\Report\VisualConstructor\Internal\Error
;
4
5
use Bitrix\Main\Entity\Result;
6
use
Bitrix\Main
;
7
12
final
class
ErrorCollection
extends
Main\ErrorCollection
13
{
19
public
function
addOne
(
Error
$error)
20
{
21
$this[] = $error;
22
}
23
29
public
function
addFromResult
(
Result
$result)
30
{
31
$errors = array();
32
foreach
($result->
getErrorMessages
() as $message)
33
{
34
$errors[] =
new
Error
($message);
35
}
36
unset($message);
37
38
$this->
add
($errors);
39
}
40
46
public
function
addFromEntity
(
IErrorable
$entity)
47
{
48
$this->
add
($entity->
getErrors
());
49
}
50
55
public
function
hasErrors
()
56
{
57
return
(
bool
)
count
($this);
58
}
59
65
public
function
getErrorsByCode($code)
66
{
67
$needle = array();
68
foreach
($this->values as $error)
69
{
71
if
($error->getCode() === $code)
72
{
73
$needle[] = $error;
74
}
75
}
76
unset($error);
77
78
return
$needle;
79
}
80
}
Bitrix\Main\ErrorCollection
Definition
errorcollection.php:14
Bitrix\Main\ErrorCollection\add
add(array $errors)
Definition
errorcollection.php:32
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\ORM\Data\Result\getErrorMessages
getErrorMessages()
Definition
result.php:79
Bitrix\Main\Type\Dictionary\count
count()
Definition
dictionary.php:187
Bitrix\Report\VisualConstructor\Internal\Error\ErrorCollection\addFromResult
addFromResult(Result $result)
Definition
errorcollection.php:29
Bitrix\Report\VisualConstructor\Internal\Error\ErrorCollection\addFromEntity
addFromEntity(IErrorable $entity)
Definition
errorcollection.php:46
Bitrix\Report\VisualConstructor\Internal\Error\ErrorCollection\hasErrors
hasErrors()
Definition
errorcollection.php:55
Bitrix\Report\VisualConstructor\Internal\Error\ErrorCollection\addOne
addOne(Error $error)
Definition
errorcollection.php:19
Bitrix\Report\VisualConstructor\Internal\Error\IErrorable
Definition
ierrorable.php:9
Bitrix\Report\VisualConstructor\Internal\Error\IErrorable\getErrors
getErrors()
Bitrix\Main
Bitrix\Report\VisualConstructor\Internal\Error
Definition
error.php:3
modules
report
lib
visualconstructor
internal
error
errorcollection.php
Создано системой
1.10.0