Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
activityadd.php
1<?php
3
6
7Loc::loadMessages(__FILE__);
8
9class 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}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29