Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
statisticsprovider.php
1
<?php
2
3
4
namespace
Bitrix\Sale\Exchange\Integration\Service\Command\Line
;
5
6
7
use
Bitrix\Sale\Exchange\Integration
;
8
9
class
StatisticsProvider
10
implements
Integration\Service\Command\IProxy
11
{
12
13
static
public
function
getProxy
()
14
{
15
return
new
Integration\Rest\RemoteProxies\Sale\StatisticsProvider
();
16
}
17
23
static
public
function
add
(array $fields)
24
{
25
$proxy = static::getProxy();
26
$r = $proxy->add($fields);
27
if
($r->isSuccess())
28
{
29
$result = $r->getData()[
'DATA'
][
'result'
];
30
}
31
else
32
{
33
throw
new
Integration\Exception\CommandLineException
(implode(
','
, $r->getErrorMessages()));
34
}
35
36
return
$result;
37
}
38
39
static
public
function
getList
($filter)
40
{
41
$proxy = static::getProxy();
42
$r = $proxy->getList([], $filter);
43
if
($r->isSuccess())
44
{
45
$result = $r->getData()[
'DATA'
][
'result'
];
46
}
47
else
48
{
49
$result[
'error'
] = $r->getErrorMessages();
50
}
51
return
$result;
52
}
53
54
// static public function register(array $params)
55
// {
56
// $result = static::getList(['xmlId'=>$params['fields']['xmlId']]);
57
//
58
// if($result['statisticProviders'][0])
59
// {
60
// $providerId = $result['statisticProviders'][0]['id'];
61
// }
62
// else
63
// {
64
// $providerId = static::add($params['fields'])['statisticProvider']['id'];
65
// }
66
//
67
// return $providerId > 0;
68
// }
69
70
}
Bitrix\Sale\Exchange\Integration\Exception\CommandLineException
Definition
commandlineexception.php:8
Bitrix\Sale\Exchange\Integration\Rest\RemoteProxies\Sale\StatisticsProvider
Definition
statisticsprovider.php:11
Bitrix\Sale\Exchange\Integration\Service\Command\Line\StatisticsProvider
Definition
statisticsprovider.php:11
Bitrix\Sale\Exchange\Integration\Service\Command\Line\StatisticsProvider\getProxy
static getProxy()
Definition
statisticsprovider.php:13
Bitrix\Sale\Exchange\Integration\Service\Command\Line\StatisticsProvider\getList
static getList($filter)
Definition
statisticsprovider.php:39
Bitrix\Sale\Exchange\Integration\Service\Command\Line\StatisticsProvider\add
static add(array $fields)
Definition
statisticsprovider.php:23
Bitrix\Sale\Exchange\Integration\Service\Command\IProxy
Definition
iproxy.php:6
Bitrix\Sale\Exchange\Integration\Service\Command\Line
Definition
app.php:2
Bitrix\Sale\Exchange\Integration
modules
sale
lib
exchange
integration
service
command
line
statisticsprovider.php
Создано системой
1.10.0