Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
errorcollection.php
1
<?php
2
3
namespace
Bitrix\Lists\Internals\Error
;
4
5
use Bitrix\Main\Entity\Result;
6
use
Bitrix\Main
;
7
8
final
class
ErrorCollection
extends
Main\ErrorCollection
9
{
15
public
function
addOne
(
Error
$error)
16
{
17
$this[] = $error;
18
}
19
25
public
function
addFromResult
(
Result
$result)
26
{
27
$errors = array();
28
foreach
($result->
getErrorMessages
() as $message)
29
{
30
$errors[] =
new
Error
($message);
31
}
32
unset($message);
33
34
$this->
add
($errors);
35
}
36
41
public
function
hasErrors
()
42
{
43
return
(
bool
)
count
($this);
44
}
45
51
public
function
getErrorsByCode($code)
52
{
53
$needle = array();
54
foreach
($this->values as $error)
55
{
57
if
($error->getCode() == $code)
58
{
59
$needle[] = $error;
60
}
61
}
62
unset($error);
63
64
return
$needle;
65
}
66
}
Bitrix\Lists\Internals\Error\ErrorCollection
Definition
errorcollection.php:9
Bitrix\Lists\Internals\Error\ErrorCollection\addFromResult
addFromResult(Result $result)
Definition
errorcollection.php:25
Bitrix\Lists\Internals\Error\ErrorCollection\hasErrors
hasErrors()
Definition
errorcollection.php:41
Bitrix\Lists\Internals\Error\ErrorCollection\addOne
addOne(Error $error)
Definition
errorcollection.php:15
Bitrix\Lists\Internals\Error\Error
Definition
error.php:8
Bitrix\Main\ErrorCollection
Definition
errorcollection.php:14
Bitrix\Main\ErrorCollection\add
add(array $errors)
Definition
errorcollection.php:32
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\Lists\Internals\Error
Definition
error.php:3
Bitrix\Main
modules
lists
lib
internals
error
errorcollection.php
Создано системой
1.10.0