forked from flarumone/flarumone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeleteAction.php
39 lines (34 loc) · 832 Bytes
/
DeleteAction.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Api\Actions;
use Flarum\Api\Request;
use Zend\Diactoros\Response\EmptyResponse;
abstract class DeleteAction implements Action
{
/**
* Delegate deletion of the resource, and return a 204 No Content
* response.
*
* @param Request $request
* @return EmptyResponse
*/
public function handle(Request $request)
{
$this->delete($request);
return new EmptyResponse(204);
}
/**
* Delete the resource.
*
* @param Request $request
* @return void
*/
abstract protected function delete(Request $request);
}