Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Arguments.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Calc
;
4
5
class
Arguments
6
{
7
protected
Parser
$parser
;
8
protected
array
$args
;
9
10
public
function
__construct
(
Parser
$parser
, ?array
$args
=
null
)
11
{
12
$this->parser =
$parser
;
13
$this->args =
$args
?? [];
14
}
15
16
public
function
getParser
():
Parser
17
{
18
return
$this->parser
;
19
}
20
21
public
function
setArgs
(array
$args
): self
22
{
23
$this->args =
$args
;
24
25
return
$this;
26
}
27
28
public
function
getArray
(): array
29
{
30
return
$this->args
;
31
}
32
33
public
function
getFlatArray
(): array
34
{
35
return \CBPHelper::flatten($this->args);
36
}
37
41
public
function
getFirst
()
42
{
43
return
$this->args[0] ??
null
;
44
}
45
49
public
function
getFirstSingle
()
50
{
51
return
$this->toSingle($this->
getFirst
());
52
}
53
57
public
function
getSecond
()
58
{
59
return
$this->args[1] ??
null
;
60
}
61
65
public
function
getSecondSingle
()
66
{
67
return
$this->toSingle($this->
getSecond
());
68
}
69
73
public
function
getThird
()
74
{
75
return
$this->args[2] ??
null
;
76
}
77
81
public
function
getThirdSingle
()
82
{
83
return
$this->toSingle($this->
getThird
());
84
}
85
89
public
function
getArg
(
int
$position)
90
{
91
return
$this->args[$position] ??
null
;
92
}
93
97
public
function
getArgSingle
(
int
$position)
98
{
99
return
$this->toSingle($this->
getArg
($position));
100
}
101
105
private
function
toSingle($value)
106
{
107
return
is_array($value) ? array_shift($value) : $value;
108
}
109
}
Bitrix\Bizproc\Calc\Arguments
Definition
Arguments.php:6
Bitrix\Bizproc\Calc\Arguments\getThirdSingle
getThirdSingle()
Definition
Arguments.php:81
Bitrix\Bizproc\Calc\Arguments\setArgs
setArgs(array $args)
Definition
Arguments.php:21
Bitrix\Bizproc\Calc\Arguments\getArray
getArray()
Definition
Arguments.php:28
Bitrix\Bizproc\Calc\Arguments\getFlatArray
getFlatArray()
Definition
Arguments.php:33
Bitrix\Bizproc\Calc\Arguments\getParser
getParser()
Definition
Arguments.php:16
Bitrix\Bizproc\Calc\Arguments\$args
array $args
Definition
Arguments.php:8
Bitrix\Bizproc\Calc\Arguments\getSecondSingle
getSecondSingle()
Definition
Arguments.php:65
Bitrix\Bizproc\Calc\Arguments\getArg
getArg(int $position)
Definition
Arguments.php:89
Bitrix\Bizproc\Calc\Arguments\getSecond
getSecond()
Definition
Arguments.php:57
Bitrix\Bizproc\Calc\Arguments\getFirstSingle
getFirstSingle()
Definition
Arguments.php:49
Bitrix\Bizproc\Calc\Arguments\getFirst
getFirst()
Definition
Arguments.php:41
Bitrix\Bizproc\Calc\Arguments\getArgSingle
getArgSingle(int $position)
Definition
Arguments.php:97
Bitrix\Bizproc\Calc\Arguments\getThird
getThird()
Definition
Arguments.php:73
Bitrix\Bizproc\Calc\Arguments\__construct
__construct(Parser $parser, ?array $args=null)
Definition
Arguments.php:10
Bitrix\Bizproc\Calc\Arguments\$parser
Parser $parser
Definition
Arguments.php:7
Bitrix\Bizproc\Calc\Parser
Definition
Parser.php:6
Bitrix\Bizproc\Calc
Definition
Arguments.php:3
modules
bizproc
lib
Calc
Arguments.php
Создано системой
1.10.0