Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
result.php
1
<?php
2
3
namespace
Bitrix\Bizproc
;
4
5
class
Result
extends
\Bitrix\Main\Result
6
{
7
public
static
function
createFromErrorCode
(
string
$code, $customData =
null
): self
8
{
9
return
static::createError(
Error::fromCode
($code, $customData));
10
}
11
12
public
static
function
createError
(
Error
$error): static
13
{
14
$res =
new
static
();
15
$res->addError($error);
16
17
return
$res;
18
}
19
20
public
static
function
createOk
(?array
$data
=
null
): static
21
{
22
$res =
new
static
();
23
24
if
(is_array(
$data
))
25
{
26
$res->setData(
$data
);
27
}
28
29
return
$res;
30
}
31
32
public
function
map
(callable $callback): self
33
{
34
if
($this->
isSuccess
())
35
{
36
return
$callback($this->
getData
());
37
}
38
39
return
$this;
40
}
41
45
public
function
getErrors
(): array
46
{
47
return
$this->errors->toArray();
48
}
49
}
Bitrix\Bizproc\Error
Definition
error.php:8
Bitrix\Bizproc\Error\fromCode
static fromCode(string $code, $customData=null)
Definition
error.php:13
Bitrix\Bizproc\Result
Definition
result.php:6
Bitrix\Bizproc\Result\createFromErrorCode
static createFromErrorCode(string $code, $customData=null)
Definition
result.php:7
Bitrix\Bizproc\Result\createError
static createError(Error $error)
Definition
result.php:12
Bitrix\Bizproc\Result\getErrors
getErrors()
Definition
result.php:45
Bitrix\Bizproc\Result\createOk
static createOk(?array $data=null)
Definition
result.php:20
Bitrix\Bizproc\Result\map
map(callable $callback)
Definition
result.php:32
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result\isSuccess
isSuccess()
Definition
result.php:39
Bitrix\Main\Result\$data
$data
Definition
result.php:22
Bitrix\Main\Result\getData
getData()
Definition
result.php:133
Bitrix\Bizproc
modules
bizproc
lib
result.php
Создано системой
1.10.0