Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
spaceeventprocessor.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Internals\EventService\Processors
;
4
5
use
Bitrix\Socialnetwork\Internals\EventService\Event
;
6
use
Bitrix\Socialnetwork\Internals\EventService\EventCollection
;
7
use
Bitrix\Socialnetwork\Internals\EventService\EventDictionary
;
8
use
Bitrix\Socialnetwork\Internals\EventService\Push\SpaceListSender
;
9
use
Bitrix\Socialnetwork\Internals\EventService\Recepients\Recepient
;
10
use
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\CounterController
;
11
use
Bitrix\Socialnetwork\Internals\Space
;
12
13
class
SpaceEventProcessor
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
}
Bitrix\Socialnetwork\Internals\Counter\CounterController
Definition
countercontroller.php:15
Bitrix\Socialnetwork\Internals\EventService\EventCollection
Definition
eventcollection.php:13
Bitrix\Socialnetwork\Internals\EventService\EventCollection\getInstance
static getInstance()
Definition
eventcollection.php:30
Bitrix\Socialnetwork\Internals\EventService\EventDictionary
Definition
eventdictionary.php:13
Bitrix\Socialnetwork\Internals\EventService\EventDictionary\SPACE_EVENTS_SUPPORTED
const SPACE_EVENTS_SUPPORTED
Definition
eventdictionary.php:55
Bitrix\Socialnetwork\Internals\EventService\Processors\SpaceEventProcessor
Definition
spaceeventprocessor.php:14
Bitrix\Socialnetwork\Internals\EventService\Processors\SpaceEventProcessor\process
process()
Definition
spaceeventprocessor.php:21
Bitrix\Socialnetwork\Internals\EventService\Push\SpaceListSender
Definition
spacelistsender.php:13
Bitrix\Socialnetwork\Internals\EventService\Recepients\Recepient
Definition
recepient.php:6
Bitrix\Socialnetwork\Internals\LiveFeed\Counter\CounterController
Definition
countercontroller.php:14
Bitrix\Socialnetwork\Internals\EventService\Event
Definition
factory.php:3
Bitrix\Socialnetwork\Internals\EventService\Processors
Definition
spaceeventprocessor.php:3
Bitrix\Socialnetwork\Internals\Space
Bitrix
modules
socialnetwork
lib
internals
eventservice
processors
spaceeventprocessor.php
Создано системой
1.10.0