1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
token.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Pull\Controller;
4
5
use Bitrix\Main\Engine;
6
use Bitrix\Main\Error;
7
use Bitrix\Pull\Model\PushTable;
8
9
class
Token
extends
Engine\Controller
10
{
11
function
removeAction
(
string
$token)
12
{
13
$tokenData = PushTable
14
::query()
15
->addSelect(
'ID'
)
16
->where(
'DEVICE_TOKEN'
, $token)
17
->unionAll(
18
PushTable
19
::query()
20
->addSelect(
'ID'
)
21
->where(
'VOIP_TOKEN'
, $token)
22
)->fetch()
23
;
24
25
26
if
(!$tokenData)
27
{
28
$this->
addError
(
new
Error
(
"No token found"
,
"NOT_FOUND"
));
29
return
;
30
}
31
32
$deleteResult = PushTable::delete($tokenData[
"ID"
]);
33
if
(!$deleteResult->isSuccess())
34
{
35
$this->
addErrors
($deleteResult->getErrors());
36
}
37
}
38
39
public
function
configureActions
()
40
{
41
$result
= parent::configureActions();
42
$result
[
'remove'
] = [
43
'-prefilters'
=> [
44
Engine\ActionFilter\Csrf::class,
45
Engine\ActionFilter\Authentication::class,
46
],
47
];
48
return
$result
;
49
}
50
}
Bitrix\Main\Engine\Controller\addError
addError(Error $error)
Определения
controller.php:1070
Bitrix\Main\Engine\Controller\addErrors
addErrors(array $errors)
Определения
controller.php:1083
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Pull\Controller\Token
Определения
token.php:10
Bitrix\Pull\Controller\Token\removeAction
removeAction(string $token)
Определения
token.php:11
Bitrix\Pull\Controller\Token\configureActions
configureActions()
Определения
token.php:39
Bitrix\Pull\Model\PushTable
Определения
pushtable.php:47
$result
$result
Определения
get_property_values.php:14
Bitrix\Main\Controller
Определения
agreement.php:2
bitrix
modules
pull
lib
controller
token.php
Создано системой
1.14.0