Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
bitrix24newuser.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Livefeed
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\UserTable
;
7
use
Bitrix\Socialnetwork\LogTable
;
8
9
final
class
Bitrix24NewUser
extends
IntranetNewUser
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
{
21
$ratingEntityId
= $this->
getEntityId
();
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
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Definition
datamanager.php:441
Bitrix\Main\UserTable
Definition
user.php:46
Bitrix\Socialnetwork\Livefeed\Bitrix24NewUser
Definition
bitrix24newuser.php:10
Bitrix\Socialnetwork\Livefeed\Bitrix24NewUser\initSourceFields
initSourceFields()
Definition
bitrix24newuser.php:19
Bitrix\Socialnetwork\Livefeed\Bitrix24NewUser\CONTENT_TYPE_ID
const CONTENT_TYPE_ID
Definition
bitrix24newuser.php:12
Bitrix\Socialnetwork\Livefeed\Bitrix24NewUser\getEventId
getEventId()
Definition
bitrix24newuser.php:14
Bitrix\Socialnetwork\Livefeed\Bitrix24NewUser\PROVIDER_ID
const PROVIDER_ID
Definition
bitrix24newuser.php:11
Bitrix\Socialnetwork\Livefeed\IntranetNewUser
Definition
intranetnewuser.php:16
Bitrix\Socialnetwork\Livefeed\Provider\getEntityId
getEntityId()
Definition
provider.php:607
Bitrix\Socialnetwork\Livefeed\Provider\setLogId
setLogId($logId)
Definition
provider.php:612
Bitrix\Socialnetwork\Livefeed\Provider\setSourceFields
setSourceFields(array $fields)
Definition
provider.php:627
Bitrix\Socialnetwork\Livefeed\Provider\setSourceTitle
setSourceTitle($title)
Definition
provider.php:665
Bitrix\Socialnetwork\Livefeed\Provider\$ratingEntityId
int null $ratingEntityId
Definition
provider.php:59
Bitrix\Socialnetwork\LogTable
Definition
log.php:36
Bitrix\Socialnetwork\Livefeed
Definition
bitrix24newuser.php:3
modules
socialnetwork
lib
livefeed
bitrix24newuser.php
Создано системой
1.10.0