Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
errorcollection.php
1
<?php
9
namespace
Bitrix\Main
;
10
11
use
Bitrix\Main\Type\Dictionary
;
12
13
class
ErrorCollection
extends
Dictionary
14
{
19
public
function
__construct
(array
$values
=
null
)
20
{
21
if
(
$values
)
22
{
23
$this->
add
(
$values
);
24
}
25
}
26
32
public
function
add
(array $errors)
33
{
34
foreach
($errors as $error)
35
{
36
$this->
setError
($error);
37
}
38
}
39
45
public
function
getErrorByCode
($code)
46
{
47
foreach
($this->values as $error)
48
{
50
if
($error->getCode() === $code)
51
{
52
return
$error;
53
}
54
}
55
56
return
null
;
57
}
58
65
public
function
setError
(
Error
$error, $offset =
null
)
66
{
67
parent::offsetSet($offset, $error);
68
}
69
75
public
function
offsetSet
($offset, $value)
76
{
77
$this->
setError
($value, $offset);
78
}
79
}
Bitrix\Main\ErrorCollection
Definition
errorcollection.php:14
Bitrix\Main\ErrorCollection\setError
setError(Error $error, $offset=null)
Definition
errorcollection.php:65
Bitrix\Main\ErrorCollection\__construct
__construct(array $values=null)
Definition
errorcollection.php:19
Bitrix\Main\ErrorCollection\add
add(array $errors)
Definition
errorcollection.php:32
Bitrix\Main\ErrorCollection\offsetSet
offsetSet($offset, $value)
Definition
errorcollection.php:75
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Type\Dictionary
Definition
dictionary.php:6
Bitrix\Main\Type\Dictionary\$values
$values
Definition
dictionary.php:10
Bitrix\Main
Bitrix\Main\getErrorByCode
getErrorByCode($code)
Definition
errorableimplementation.php:53
modules
main
lib
errorcollection.php
Создано системой
1.10.0