Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
proxy.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Service\Batchable
;
3
4
5
use
Bitrix\Sale\Exchange\Integration
;
6
7
abstract
class
Proxy
extends
Base
8
{
12
abstract
static
protected
function
getProxy
();
13
14
static
public
function
proxyList
(array $filter)
15
{
16
$proxy = static::getProxy();
17
$r = $proxy->getList([], $filter);
18
if
($r->isSuccess())
19
{
20
$result = $r->getData()[
'DATA'
][
'result'
];
21
}
22
else
23
{
24
$result[
'error'
] = $r->getErrorMessages();
25
}
26
return
$result;
27
}
28
static
public
function
proxyAdds
(array $list)
29
{
30
$proxy = static::getProxy();
31
$list = static::prepareFieldsAdds($list);
32
$r = $proxy->adds($list);
33
if
($r->isSuccess())
34
{
35
/*
36
* [result] => Array()
37
[result_error] => Array
38
(
39
[3] => Array
40
(
41
[error] =>
42
[error_description] => Не введено значение обязательного поля "Имя" или "Фамилия"
43
)
44
)
45
* */
46
$result = $r->getData()[
'DATA'
][
'result'
];
47
}
48
else
49
{
50
$result[
'error'
] = $r->getErrorMessages();
51
}
52
return
$result;
53
}
54
55
static
protected
function
prepareFieldsAdds
(
$fields
)
56
{
57
$result = [];
58
foreach
(
$fields
as $index=>$item)
59
{
60
$result[$index] = [
'fields'
=>$item];
61
}
62
return
$result;
63
}
64
}
Bitrix\Sale\Exchange\Integration\CRM\Placement\Base
Definition
base.php:11
Bitrix\Sale\Exchange\Integration\CRM\Placement\Base\$fields
$fields
Definition
base.php:12
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy
Definition
proxy.php:8
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy\proxyAdds
static proxyAdds(array $list)
Definition
proxy.php:28
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy\getProxy
static getProxy()
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy\proxyList
static proxyList(array $filter)
Definition
proxy.php:14
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy\prepareFieldsAdds
static prepareFieldsAdds($fields)
Definition
proxy.php:55
Bitrix\Sale\Exchange\Integration\Service\Batchable
Definition
activity.php:2
Bitrix\Sale\Exchange\Integration
modules
sale
lib
exchange
integration
service
batchable
proxy.php
Создано системой
1.10.0