Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
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::getList([
14
"filter"
=> [
"=DEVICE_TOKEN"
=> $token]
15
])->fetch();
16
17
if
(!$tokenData)
18
{
19
$this->
addError
(
new
Error
(
"No token found"
,
"NOT_FOUND"
));
20
return
;
21
}
22
23
$deleteResult = PushTable::delete($tokenData[
"ID"
]);
24
if
(!$deleteResult->isSuccess())
25
{
26
$this->
addErrors
($deleteResult->getErrors());
27
}
28
}
29
30
public
function
configureActions
()
31
{
32
$result = parent::configureActions();
33
$result[
'remove'
] = array(
34
'-prefilters'
=> array(
35
Engine\ActionFilter\Csrf::class,
36
Engine\ActionFilter\Authentication::class,
37
)
38
);
39
return
$result;
40
}
41
}
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Main\Engine\Controller\addError
addError(Error $error)
Definition
controller.php:1051
Bitrix\Main\Engine\Controller\addErrors
addErrors(array $errors)
Definition
controller.php:1064
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Pull\Controller\Token
Definition
token.php:10
Bitrix\Pull\Controller\Token\removeAction
removeAction(string $token)
Definition
token.php:11
Bitrix\Pull\Controller\Token\configureActions
configureActions()
Definition
token.php:30
Bitrix\Pull\Model\PushTable
Definition
pushtable.php:47
Bitrix\Main\Engine
Definition
action.php:3
Bitrix\Pull\Controller
Definition
channel.php:3
modules
pull
lib
controller
token.php
Создано системой
1.10.0