Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bitrix24newuser.php
1<?php
2
4
8
10{
11 public const PROVIDER_ID = 'BITRIX24_NEW_USER';
12 public const CONTENT_TYPE_ID = 'BITRIX24_NEW_USER';
13
14 public function getEventId(): array
15 {
16 return [ 'bitrix24_new_user' ];
17 }
18
19 public function initSourceFields()
20 {
22 $userId = 0;
23
24 if (!empty($ratingEntityId))
25 {
26 $res = LogTable::getList(array(
27 'filter' => array(
28 '@EVENT_ID' => $this->getEventId(),
29 '=RATING_ENTITY_ID' => $ratingEntityId
30 ),
31 'select' => array('ID', 'ENTITY_ID')
32 ));
33 if ($logEntry = $res->fetch())
34 {
35 $this->setLogId($logEntry['ID']);
36 $userId = $logEntry['ENTITY_ID'];
37 }
38 }
39
40 if ($userId > 0)
41 {
42 $res = UserTable::getList(array(
43 'filter' => array(
44 '=ID' => $userId
45 )
46 ));
47 if ($user = $res->fetch())
48 {
49 $this->setSourceFields($user);
50
51 $userName = \CUser::formatName(
52 \CSite::getNameFormat(),
53 $user,
54 true,
55 false
56 );
57 $user['FULL_NAME'] = $userName;
58
59 $this->setSourceFields(array_merge($user, array('LOG_ENTRY' => $logEntry)));
60 $this->setSourceTitle(Loc::getMessage('SONET_LIVEFEED_BITRIX24_NEW_USER_TITLE', array(
61 '#USER_NAME#' => $userName
62 )));
63 }
64 }
65 }
66}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getList(array $parameters=array())