Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
spaceeventprocessor.php
1<?php
2
4
12
14{
21 public function process(): void
22 {
23 if (!\Bitrix\Socialnetwork\Space\Service::isAvailable())
24 {
25 return;
26 }
27
28 foreach (EventCollection::getInstance()->list() as $event)
29 {
30 /* @var Event $event */
31 if (!in_array($event->getType(), EventDictionary::SPACE_EVENTS_SUPPORTED, true))
32 {
33 continue;
34 }
35
36 foreach ($event->getRecepients() as $recepient)
37 {
38 /* @var Recepient $recepient */
39 // recount live-feed counters in case event is one of the live-feeds'
40 (new CounterController($recepient->getId()))->process($event);
41
42 // recount space counters and push events for real-time
43 Space\Counter::getInstance($recepient->getId())->recount();
44
45 // save space recent activity
46 // .....
47 }
48 }
49 }
50}