1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
countercontroller.php
См. документацию.
1<?php
2
3namespace Bitrix\Socialnetwork\Internals\Space\Counter;
4
5use Bitrix\Socialnetwork\Internals\EventService\Event;
6use Bitrix\Socialnetwork\Internals\EventService\Recepients\Recepient;
7use Bitrix\Socialnetwork\Internals\Space\Counter;
8
10{
11 private int $userId;
12
13 public function __construct(int $userId = 0)
14 {
15 $this->userId = $userId;
16 }
17
18 public function process(Event $event, Recepient $user): void
19 {
20 if (!in_array($event->getType(), Dictionary::SUPPORTED_EVENTS, true))
21 {
22 return;
23 }
24
25 Counter::getInstance($this->userId)->updateLeftMenuCounter();
26
27 if (!$user->isWatchingSpaces())
28 {
29 return;
30 }
31
32 (new PushSender())->createPush(
33 [$this->userId],
35 Counter::getInstance($this->userId)->getMemberSpaceCounters(),
36 );
37 }
38}
static getInstance()
Определения application.php:98
$user
Определения mysql_to_pgsql.php:33
$event
Определения prolog_after.php:141