Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
activityadd.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Service\Scenarios
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
use
Bitrix\Sale\Exchange\Integration\Service\Batchable
;
6
7
Loc::loadMessages
(__FILE__);
8
9
class
ActivityAdd
extends
Base
10
implements
INamingEntity
11
{
12
public
function
adds
(array $params)
13
{
14
$activity =
new
Batchable\Activity
();
15
return
$activity->init($params)
16
->adds()
17
->getCollection();
18
}
19
20
static
public
function
prepareFields
($params)
21
{
22
$result = [];
23
foreach
($params as $index=>$param)
24
{
25
$deal =
new
Batchable\Deal
();
26
27
$relation = static::loadRelation($index, $deal->getSrcEntityTypeId(), $deal->getDstEntityTypeId());
28
$dealId = $relation->getDestinationEntityId();
29
if
($dealId>0)
30
{
31
$result[$index] = [
32
//'ID' => $param['ID'],
33
'SUBJECT'
=> static::getNamingEntity([
'ID'
=>$relation->getSourceEntityId()]),
34
'OWNER_TYPE_ID'
=> $relation->getDestinationEntityTypeId(),
35
'OWNER_ID'
=> $relation->getDestinationEntityId(),
36
];
37
}
38
}
39
return
$result;
40
}
41
42
static
public
function
getNamingEntity
(array $fields)
43
{
44
return
Loc::getMessage
(
"SALE_INTEGRATIONB24_SERVICE_SCENARIOS_NAME"
).$fields[
'ID'
];
45
}
46
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Exchange\Integration\App\Base
Definition
base.php:8
Bitrix\Sale\Exchange\Integration\Service\Batchable\Activity
Definition
activity.php:8
Bitrix\Sale\Exchange\Integration\Service\Batchable\Deal
Definition
deal.php:10
Bitrix\Sale\Exchange\Integration\Service\Scenarios\ActivityAdd
Definition
activityadd.php:11
Bitrix\Sale\Exchange\Integration\Service\Scenarios\ActivityAdd\prepareFields
static prepareFields($params)
Definition
activityadd.php:20
Bitrix\Sale\Exchange\Integration\Service\Scenarios\ActivityAdd\adds
adds(array $params)
Definition
activityadd.php:12
Bitrix\Sale\Exchange\Integration\Service\Scenarios\ActivityAdd\getNamingEntity
static getNamingEntity(array $fields)
Definition
activityadd.php:42
Bitrix\Sale\Exchange\Integration\Service\Scenarios\INamingEntity
Definition
inamingentity.php:5
Bitrix\Sale\Exchange\Integration\Service\Batchable
Definition
activity.php:2
Bitrix\Sale\Exchange\Integration\Service\Scenarios
Definition
activityadd.php:2
modules
sale
lib
exchange
integration
service
scenarios
activityadd.php
Создано системой
1.10.0