Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
logentry.php
1<?php
9
13
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?>
getParameter($key)
Definition event.php:80
Definition logentry.php:15
static onGetContentId(Event $event)
Definition logentry.php:53
static onSetContentView(Event $event)
Definition logentry.php:16