Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
token.php
1<?php
2
4
8
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}
removeAction(string $token)
Definition token.php:11