Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
analytics.php
1
<?php
2
3
namespace
Bitrix\Calendar\Integration\Im
;
4
5
use
Bitrix\Calendar\Sharing
;
6
use
Bitrix\Im
;
7
use
Bitrix\Main
;
8
9
class
Analytics
10
{
11
public
static
function
onCallCreate
(Main\
Event
$moduleEvent): void
12
{
13
Main\Application::getInstance()->addBackgroundJob([self::class,
'sendAnalyticsCallStarted'
], [$moduleEvent]);
14
}
15
16
public
static
function
sendAnalyticsCallStarted
(Main\
Event
$moduleEvent): void
17
{
18
if
(!Main\
Loader::includeModule
(
'im'
))
19
{
20
return
;
21
}
22
23
$chatId = (int)($moduleEvent->getParameters()[
'chatId'
] ??
null
);
24
if
($chatId <= 0)
25
{
26
return
;
27
}
28
29
$conferenceId = Im\V2\Chat::getInstance($chatId)->getAliasName();
30
if
(!is_string($conferenceId))
31
{
32
return
;
33
}
34
35
$parentLink = (
new
Sharing\Link\Factory
())->getParentLinkByConferenceId($conferenceId);
36
if
(is_null($parentLink))
37
{
38
return
;
39
}
40
41
Sharing\Analytics::getInstance()->sendCallStarted($parentLink);
42
}
43
}
Bitrix\Calendar\Core\Event\Event
Definition
event.php:20
Bitrix\Calendar\Core\Mappers\Factory
Definition
factory.php:6
Bitrix\Calendar\Integration\Im\Analytics
Definition
analytics.php:10
Bitrix\Calendar\Integration\Im\Analytics\sendAnalyticsCallStarted
static sendAnalyticsCallStarted(Main\Event $moduleEvent)
Definition
analytics.php:16
Bitrix\Calendar\Integration\Im\Analytics\onCallCreate
static onCallCreate(Main\Event $moduleEvent)
Definition
analytics.php:11
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Definition
loader.php:69
Bitrix\Calendar\Integration\Im
Definition
analytics.php:3
Bitrix\Calendar\Sharing
Definition
analytics.php:3
Bitrix\Im
Bitrix\Main
modules
calendar
lib
integration
im
analytics.php
Создано системой
1.10.0