1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
collablistener.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Calendar\Integration\SocialNetwork\Collab\counter
;
4
5
use
Bitrix\Calendar\Internals\Counter
;
6
use
Bitrix\Main\Loader
;
7
use
Bitrix\Socialnetwork\Collab\Entity\Event\EventDispatcher
;
8
use
Bitrix\Socialnetwork\Collab\Registry\CollabRegistry
;
9
10
class
CollabListener
11
{
12
public
function
notify
(
array
$groupsToNotify): void
13
{
14
if
(!$this->isAvailable())
15
{
16
return
;
17
}
18
19
foreach
($groupsToNotify as $groupId => $userIds)
20
{
21
$group =
CollabRegistry::getInstance
()->get($groupId);
22
23
if
($group ===
null
)
24
{
25
continue
;
26
}
27
28
$this->notifyDispatcher($groupId, $userIds);
29
}
30
}
31
32
private
function
notifyDispatcher(
int
$groupId,
array
$userIds): void
33
{
34
$counters
= [];
35
foreach
($userIds as
$userId
)
36
{
37
$counter
=
Counter::getInstance
(
$userId
)->get(
Counter
\
CounterDictionary::COUNTER_GROUP_INVITES
, $groupId);
38
$counters
[
$userId
] =
$counter
;
39
}
40
41
EventDispatcher::onCountersRecount
($groupId,
$counters
,
'calendar'
);
42
}
43
44
private
function
isAvailable(): bool
45
{
46
return
Loader::includeModule(
'socialnetwork'
);
47
}
48
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Calendar\Integration\SocialNetwork\Collab\counter\CollabListener
Определения
collablistener.php:11
Bitrix\Calendar\Integration\SocialNetwork\Collab\counter\CollabListener\notify
notify(array $groupsToNotify)
Определения
collablistener.php:12
Bitrix\Calendar\Internals\Counter\CounterDictionary\COUNTER_GROUP_INVITES
const COUNTER_GROUP_INVITES
Определения
counterdictionary.php:18
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
Bitrix\Main\Loader
Определения
loader.php:13
Bitrix\Socialnetwork\Collab\Entity\Event\EventDispatcher
Определения
EventDispatcher.php:40
Bitrix\Socialnetwork\Collab\Entity\Event\EventDispatcher\onCountersRecount
static onCountersRecount(int $collabId, array $counters, string $entityType)
Определения
EventDispatcher.php:41
Bitrix\Socialnetwork\Collab\Registry\CollabRegistry
Определения
CollabRegistry.php:14
Bitrix\Socialnetwork\Collab\Registry\CollabRegistry\getInstance
static getInstance()
Определения
CollabRegistry.php:17
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Calendar\Integration\SocialNetwork\Collab\counter
Определения
collablistener.php:3
Bitrix\Calendar\Internals\Counter
Определения
counterdictionary.php:3
$counter
$counter
Определения
options.php:5
$counters
$counters
Определения
options.php:100
bitrix
modules
calendar
lib
integration
socialnetwork
collab
counter
collablistener.php
Создано системой
1.14.0