Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
startscriptresult.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Script
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\Result
;
7
use
Bitrix\Main\Error
;
8
9
class
StartScriptResult
extends
Result
10
{
11
public
const
CODE_NOT_ENOUGH_RIGHTS
=
'NOT_ENOUGH_RIGHTS'
;
12
public
const
CODE_SCRIPT_NOT_EXIST
=
'SCRIPT_NOT_EXIST'
;
13
public
const
CODE_INACTIVE_SCRIPT
=
'INACTIVE_SCRIPT'
;
14
public
const
CODE_TEMPLATE_NOT_EXIST
=
'TEMPLATE_NOT_EXIST'
;
15
public
const
CODE_EMPTY_TEMPLATE_PARAMETERS
=
'EMPTY_TEMPLATE_PARAMETERS'
;
16
public
const
CODE_INVALID_PARAMETERS
=
'INVALID_PARAMETERS'
;
17
18
public
function
addNotEnoughRightsError
():
StartScriptResult
19
{
20
$this->
addError
(
new
Error
(
21
Loc::getMessage
(
'BIZPROC_LIB_SCRIPT_START_SCRIPT_RESULT_NOT_ENOUGH_RIGHTS'
),
22
self::CODE_NOT_ENOUGH_RIGHTS)
23
);
24
25
return
$this;
26
}
27
28
public
function
addScriptNotExistError
():
StartScriptResult
29
{
30
$this->
addError
(
new
Error
(
31
Loc::getMessage
(
'BIZPROC_LIB_SCRIPT_START_SCRIPT_RESULT_SCRIPT_NOT_EXIST'
),
32
self::CODE_SCRIPT_NOT_EXIST)
33
);
34
35
return
$this;
36
}
37
38
public
function
addInactiveScriptError
():
StartScriptResult
39
{
40
$this->
addError
(
new
Error
(
41
Loc::getMessage
(
'BIZPROC_LIB_SCRIPT_START_SCRIPT_RESULT_INACTIVE_SCRIPT'
),
42
self::CODE_INACTIVE_SCRIPT)
43
);
44
45
return
$this;
46
}
47
48
public
function
addTemplateNotExistError
():
StartScriptResult
49
{
50
$this->
addError
(
new
Error
(
51
Loc::getMessage
(
'BIZPROC_LIB_SCRIPT_START_SCRIPT_RESULT_TEMPLATE_NOT_EXIST'
),
52
self::CODE_TEMPLATE_NOT_EXIST)
53
);
54
55
return
$this;
56
}
57
58
public
function
addEmptyTemplateParameterError
():
StartScriptResult
59
{
60
$this->
addError
(
new
Error
(
61
Loc::getMessage
(
'BIZPROC_LIB_SCRIPT_START_SCRIPT_RESULT_EMPTY_TEMPLATE_PARAMETERS'
),
62
self::CODE_EMPTY_TEMPLATE_PARAMETERS)
63
);
64
65
return
$this;
66
}
67
68
public
function
addInvalidParameterErrors
(array
$errors
):
StartScriptResult
69
{
70
foreach
(
$errors
as $error)
71
{
72
$this->
addError
(
new
Error
($error[
'message'
], self::CODE_INVALID_PARAMETERS));
73
}
74
75
return
$this;
76
}
77
}
Bitrix\Bizproc\Script\StartScriptResult
Definition
startscriptresult.php:10
Bitrix\Bizproc\Script\StartScriptResult\CODE_TEMPLATE_NOT_EXIST
const CODE_TEMPLATE_NOT_EXIST
Definition
startscriptresult.php:14
Bitrix\Bizproc\Script\StartScriptResult\CODE_NOT_ENOUGH_RIGHTS
const CODE_NOT_ENOUGH_RIGHTS
Definition
startscriptresult.php:11
Bitrix\Bizproc\Script\StartScriptResult\CODE_INACTIVE_SCRIPT
const CODE_INACTIVE_SCRIPT
Definition
startscriptresult.php:13
Bitrix\Bizproc\Script\StartScriptResult\addScriptNotExistError
addScriptNotExistError()
Definition
startscriptresult.php:28
Bitrix\Bizproc\Script\StartScriptResult\addNotEnoughRightsError
addNotEnoughRightsError()
Definition
startscriptresult.php:18
Bitrix\Bizproc\Script\StartScriptResult\CODE_EMPTY_TEMPLATE_PARAMETERS
const CODE_EMPTY_TEMPLATE_PARAMETERS
Definition
startscriptresult.php:15
Bitrix\Bizproc\Script\StartScriptResult\addInvalidParameterErrors
addInvalidParameterErrors(array $errors)
Definition
startscriptresult.php:68
Bitrix\Bizproc\Script\StartScriptResult\addInactiveScriptError
addInactiveScriptError()
Definition
startscriptresult.php:38
Bitrix\Bizproc\Script\StartScriptResult\CODE_SCRIPT_NOT_EXIST
const CODE_SCRIPT_NOT_EXIST
Definition
startscriptresult.php:12
Bitrix\Bizproc\Script\StartScriptResult\addEmptyTemplateParameterError
addEmptyTemplateParameterError()
Definition
startscriptresult.php:58
Bitrix\Bizproc\Script\StartScriptResult\addTemplateNotExistError
addTemplateNotExistError()
Definition
startscriptresult.php:48
Bitrix\Bizproc\Script\StartScriptResult\CODE_INVALID_PARAMETERS
const CODE_INVALID_PARAMETERS
Definition
startscriptresult.php:16
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result\addError
addError(Error $error)
Definition
result.php:50
Bitrix\Main\Result\$errors
$errors
Definition
result.php:19
Bitrix\Bizproc\Script
modules
bizproc
lib
script
startscriptresult.php
Создано системой
1.10.0