Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
batch.php
1
<?
8
namespace
Bitrix\Seo\WebHook\Payload
;
9
15
class
Batch
16
{
18
protected
$items
= [];
19
21
protected
$requestId
;
22
24
protected
$source
;
25
27
protected
$code
;
28
30
protected
$externalId
;
31
38
public
function
setLeadItemsArray
(array
$items
)
39
{
40
foreach
(
$items
as $item)
41
{
42
$this->
addItem
(
new
LeadItem
($item));
43
}
44
45
return
$this;
46
}
47
54
public
function
setArray
(array $data)
55
{
56
$this->
setRequestId
($data[
'requestId'
])
57
->setLeadItemsArray($data[
'items'
])
58
->setCode($data[
'code'
])
59
->setExternalId($data[
'externalId'
])
60
->setSource($data[
'source'
]);
61
62
return
$this;
63
}
64
65
public
function
getArray()
66
{
67
return
[
68
'code'
=> $this->
getCode
(),
69
'externalId'
=> $this->
getExternalId
(),
70
'requestId'
=> $this->
getRequestId
(),
71
'items'
=> array_map(
72
function
($item)
73
{
75
return
$item->getData();
76
},
77
$this->
getItems
()
78
),
79
'source'
=> $this->
getSource
(),
80
];
81
}
82
88
public
function
getItems
()
89
{
90
return
$this->items
;
91
}
92
99
public
function
addItem
(
Item
$item)
100
{
101
$this->items[] = $item;
102
return
$this;
103
}
104
110
public
function
getRequestId
()
111
{
112
return
$this->requestId
;
113
}
114
121
public
function
setRequestId
(
$requestId
)
122
{
123
$this->requestId =
$requestId
;
124
return
$this;
125
}
126
132
public
function
getSource
()
133
{
134
return
$this->source
;
135
}
136
143
public
function
setSource
(
$source
)
144
{
145
$this->source =
$source
;
146
return
$this;
147
}
148
154
public
function
getCode
()
155
{
156
return
$this->code
;
157
}
158
165
public
function
setCode
(
$code
)
166
{
167
$this->code =
$code
;
168
return
$this;
169
}
170
176
public
function
getExternalId
()
177
{
178
return
$this->externalId
;
179
}
180
187
public
function
setExternalId
(
$externalId
)
188
{
189
$this->externalId =
$externalId
;
190
return
$this;
191
}
192
}
193
Bitrix\Seo\WebHook\Payload\Batch
Definition
batch.php:16
Bitrix\Seo\WebHook\Payload\Batch\getSource
getSource()
Definition
batch.php:132
Bitrix\Seo\WebHook\Payload\Batch\setSource
setSource($source)
Definition
batch.php:143
Bitrix\Seo\WebHook\Payload\Batch\$items
$items
Definition
batch.php:18
Bitrix\Seo\WebHook\Payload\Batch\$code
$code
Definition
batch.php:27
Bitrix\Seo\WebHook\Payload\Batch\$externalId
$externalId
Definition
batch.php:30
Bitrix\Seo\WebHook\Payload\Batch\setCode
setCode($code)
Definition
batch.php:165
Bitrix\Seo\WebHook\Payload\Batch\$source
$source
Definition
batch.php:24
Bitrix\Seo\WebHook\Payload\Batch\setArray
setArray(array $data)
Definition
batch.php:54
Bitrix\Seo\WebHook\Payload\Batch\setRequestId
setRequestId($requestId)
Definition
batch.php:121
Bitrix\Seo\WebHook\Payload\Batch\getItems
getItems()
Definition
batch.php:88
Bitrix\Seo\WebHook\Payload\Batch\addItem
addItem(Item $item)
Definition
batch.php:99
Bitrix\Seo\WebHook\Payload\Batch\getCode
getCode()
Definition
batch.php:154
Bitrix\Seo\WebHook\Payload\Batch\getExternalId
getExternalId()
Definition
batch.php:176
Bitrix\Seo\WebHook\Payload\Batch\setLeadItemsArray
setLeadItemsArray(array $items)
Definition
batch.php:38
Bitrix\Seo\WebHook\Payload\Batch\getRequestId
getRequestId()
Definition
batch.php:110
Bitrix\Seo\WebHook\Payload\Batch\$requestId
$requestId
Definition
batch.php:21
Bitrix\Seo\WebHook\Payload\Batch\setExternalId
setExternalId($externalId)
Definition
batch.php:187
Bitrix\Seo\WebHook\Payload\Item
Definition
item.php:18
Bitrix\Seo\WebHook\Payload\LeadItem
Definition
leaditem.php:27
Bitrix\Seo\WebHook\Payload
Definition
batch.php:8
modules
seo
lib
webhook
payload
batch.php
Создано системой
1.10.0