1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
CheckMessageDisappearingDuration.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Controller\Filter;
4
5
use Bitrix\Im\V2\Chat\ChatError;
6
use Bitrix\Im\V2\Message\Delete\DisappearService;
7
use Bitrix\Main\Engine\ActionFilter\Base;
8
use Bitrix\Main\Event;
9
use Bitrix\Main\EventResult;
10
11
class
CheckMessageDisappearingDuration
extends
Base
12
{
13
public
function
onBeforeAction
(
Event
$event
)
14
{
15
$arguments = $this->
getAction
()->getArguments();
16
$hours
= $arguments[
'hours'
];
17
if
(is_numeric(
$hours
) && (
int
)
$hours
> 0 && in_array(
$hours
, DisappearService::TIME_WHITELIST))
18
{
19
return
null
;
20
}
21
22
$this->
addError
(
new
ChatError
(ChatError::WRONG_DISAPPEARING_DURATION,
'Wrong disappearing duration'
));
23
return
new
EventResult
(EventResult::ERROR,
null
,
null
, $this);
24
}
25
}
Bitrix\Im\V2\Chat\ChatError
Определения
ChatError.php:9
Bitrix\Im\V2\Controller\Filter\CheckMessageDisappearingDuration
Определения
CheckMessageDisappearingDuration.php:12
Bitrix\Im\V2\Controller\Filter\CheckMessageDisappearingDuration\onBeforeAction
onBeforeAction(Event $event)
Определения
CheckMessageDisappearingDuration.php:13
Bitrix\Main\Engine\ActionFilter\Base
Определения
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\addError
addError(Error $error)
Определения
base.php:80
Bitrix\Main\Engine\ActionFilter\Base\getAction
getAction()
Определения
base.php:48
Bitrix\Main\EventResult
Определения
eventresult.php:5
$hours
$hours
Определения
cron_html_pages.php:15
Bitrix\Im\V2\Chat\ExternalChat\Event
Определения
AfterCreateEvent.php:3
$event
$event
Определения
prolog_after.php:141
bitrix
modules
im
lib
V2
Controller
Filter
CheckMessageDisappearingDuration.php
Создано системой
1.14.0