Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logentry.php
1
<?php
8
namespace
Bitrix\Socialnetwork\Integration\Mobile
;
9
10
use
Bitrix\Socialnetwork\Livefeed\Provider
;
11
use
Bitrix\Main\Event
;
12
use
Bitrix\Main\EventResult
;
13
14
class
LogEntry
15
{
16
public
static
function
onSetContentView
(
Event
$event)
17
{
18
$result =
new
EventResult
(
19
EventResult::UNDEFINED,
20
array(),
21
'socialnetwork'
22
);
23
24
$logEventFields = $event->
getParameter
(
'logEventFields'
);
25
26
if
(!is_array($logEventFields))
27
{
28
return
$result;
29
}
30
31
if
($contentId = Provider::getContentId($logEventFields))
32
{
33
if
($liveFeedEntity = Provider::init(array(
34
'ENTITY_TYPE'
=> $contentId[
'ENTITY_TYPE'
],
35
'ENTITY_ID'
=> $contentId[
'ENTITY_ID'
],
36
'LOG_ID'
=> $logEventFields[
"ID"
]
37
)))
38
{
39
if
($liveFeedEntity->setContentView())
40
{
41
$result =
new
EventResult
(
42
EventResult::SUCCESS,
43
array(),
44
'socialnetwork'
45
);
46
}
47
}
48
}
49
50
return
$result;
51
}
52
53
public
static
function
onGetContentId
(
Event
$event)
54
{
55
$result =
new
EventResult
(
56
EventResult::UNDEFINED,
57
array(),
58
'socialnetwork'
59
);
60
61
$logEventFields = $event->
getParameter
(
'logEventFields'
);
62
63
if
(!is_array($logEventFields))
64
{
65
return
$result;
66
}
67
68
if
($contentId = Provider::getContentId($logEventFields))
69
{
70
$result =
new
EventResult
(
71
EventResult::SUCCESS,
72
array(
73
'contentId'
=> $contentId
74
),
75
'socialnetwork'
76
);
77
}
78
79
return
$result;
80
}
81
}
82
?>
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\Event\getParameter
getParameter($key)
Definition
event.php:80
Bitrix\Main\EventResult
Definition
eventresult.php:5
Bitrix\Socialnetwork\Integration\Mobile\LogEntry
Definition
logentry.php:15
Bitrix\Socialnetwork\Integration\Mobile\LogEntry\onGetContentId
static onGetContentId(Event $event)
Definition
logentry.php:53
Bitrix\Socialnetwork\Integration\Mobile\LogEntry\onSetContentView
static onSetContentView(Event $event)
Definition
logentry.php:16
Bitrix\Socialnetwork\Livefeed\Provider
Definition
provider.php:22
Bitrix\Socialnetwork\Integration\Mobile
Definition
logentry.php:8
modules
socialnetwork
lib
integration
mobile
logentry.php
Создано системой
1.10.0