Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
client.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Service\Batchable
;
3
4
5
use
Bitrix\Main\Error
;
6
use
Bitrix\Sale\Exchange\Integration
;
7
use
Bitrix\Sale\Order
;
8
9
abstract
class
Client
extends
Proxy
10
{
11
static
public
function
resolveFieldsValuesFromOrderList
(array $params)
12
{
13
$indexes = static::getIndexesFromParams($params);
14
$list = static::getUsersFieldsValues($indexes);
15
16
return
count($list)>0 ? static::collapseUserList($list):[];
17
}
18
static
public
function
getUserCollectionFromOrderList
(array $params)
19
{
20
$indexes = static::getIndexesFromParams($params);
21
return
static::loadUserCollection($indexes);
22
}
23
24
static
protected
function
collapseUserList
(array $list)
25
{
26
$result = [];
27
foreach
($list as $item)
28
{
29
$result[$item[
'ID'
]] = $item;
30
}
31
return
$result;
32
}
33
34
abstract
static
protected
function
getUsersFieldsValues
(array $indexes);
35
36
//resolveClients
37
38
static
protected
function
loadUserCollection
($indexes)
39
{
40
$clients =
new
Integration\Service\User\Container\Collection
();
41
foreach
($indexes as $index)
42
{
43
$order =
Order::load
($index);
44
45
$typeName = Integration\Service\User\Entity\Base::resolveNamePersonDomain($order->getPersonTypeId());
46
$clients->addItem(
47
Integration\
Service
\
User
\Container\Item::create(
48
Integration\
Service
\
User
\
Factory::create
(
49
Integration\
Service
\
User
\EntityType::resolveId($typeName))
50
->load($order))->setInternalIndex($index));
51
}
52
return
$clients;
53
}
54
static
protected
function
getUserCollectionByTypeId(Integration\
Service
\
User
\Container\
Collection
$collection, $typeId)
55
{
56
$clients =
new
Integration\Service\User\Container\Collection
();
58
foreach
($collection as $item)
59
{
60
if
($item->getEntity()->getType() == $typeId)
61
{
62
$clients->addItem($item);
63
}
64
}
65
return
$clients;
66
}
67
}
Bitrix\Location\Entity\Location\Collection
Definition
collection.php:15
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Sale\Discount\Context\User
Definition
user.php:6
Bitrix\Sale\Exchange\Integration\Admin\Factory\create
static create($type)
Definition
factory.php:7
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client
Definition
client.php:10
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client\loadUserCollection
static loadUserCollection($indexes)
Definition
client.php:38
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client\getUserCollectionFromOrderList
static getUserCollectionFromOrderList(array $params)
Definition
client.php:18
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client\collapseUserList
static collapseUserList(array $list)
Definition
client.php:24
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client\resolveFieldsValuesFromOrderList
static resolveFieldsValuesFromOrderList(array $params)
Definition
client.php:11
Bitrix\Sale\Exchange\Integration\Service\Batchable\Client\getUsersFieldsValues
static getUsersFieldsValues(array $indexes)
Bitrix\Sale\Exchange\Integration\Service\Batchable\Proxy
Definition
proxy.php:8
Bitrix\Sale\Exchange\Integration\Service\User\Container\Collection
Definition
collection.php:7
Bitrix\Sale\Helpers\Order
Definition
order.php:10
Bitrix\Sale\OrderBase\load
static load($id)
Definition
orderbase.php:245
Bitrix\Sale\PaySystem\Service
Definition
service.php:31
Bitrix\Sale\Exchange\Integration\Service\Batchable
Definition
activity.php:2
Bitrix\Sale\Exchange\Integration
modules
sale
lib
exchange
integration
service
batchable
client.php
Создано системой
1.10.0