1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
PlatformContext.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Controller\Filter;
4
5
use Bitrix\Im\Bot;
6
use Bitrix\Main\Engine\ActionFilter\Base;
7
use Bitrix\Main\Event;
8
use Bitrix\Rest\SessionAuth\Auth;
9
use CRestServer;
10
11
class
PlatformContext
extends
Base
12
{
13
public
function
onBeforeAction
(
Event
$event
)
14
{
15
$server = $this->
getAction
()->getArguments()[
'restServer'
] ??
null
;
16
17
if
($server instanceof CRestServer && $server->getAuthType() !==
Auth::AUTH_TYPE
)
18
{
19
$context
= $this->
getAction
()->getController()->getRequest()->getValues()[
'platformContext'
] ??
null
;
20
21
if
(is_string(
$context
))
22
{
23
Bot::setPlatformContext(
$context
);
24
}
25
}
26
27
return
null
;
28
}
29
}
Bitrix\Im\V2\Controller\Filter\PlatformContext
Определения
PlatformContext.php:12
Bitrix\Im\V2\Controller\Filter\PlatformContext\onBeforeAction
onBeforeAction(Event $event)
Определения
PlatformContext.php:13
Bitrix\Main\Engine\ActionFilter\Base
Определения
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\getAction
getAction()
Определения
base.php:48
Bitrix\Rest\SessionAuth\Auth\AUTH_TYPE
const AUTH_TYPE
Определения
auth.php:18
$context
$context
Определения
csv_new_setup.php:223
Bitrix\Im\V2\Chat\ExternalChat\Event
Определения
AfterCreateEvent.php:3
$event
$event
Определения
prolog_after.php:141
bitrix
modules
im
lib
V2
Controller
Filter
PlatformContext.php
Создано системой
1.14.0