Test Failed
Pull Request — master (#88)
by Maximo
06:27
created

SystemModulesController::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Api\Controllers;
6
7
use Canvas\Models\SystemModules;
8
use Phalcon\Http\Response;
9
10
/**
11
 * Class SystemModulesController.
12
 *
13
 * @package Canvas\Api\Controllers
14
 *
15
 */
16
class SystemModulesController extends BaseController
17
{
18
    /*
19
     * fields we accept to create
20
     *
21
     * @var array
22
     */
23
    protected $createFields = [];
24
25
    /*
26
     * fields we accept to create
27
     *
28
     * @var array
29
     */
30
    protected $updateFields = ['show'];
31
32
    /**
33
     * set objects.
34
     *
35
     * @return void
36
     */
37
    public function onConstruct()
38
    {
39
        $this->model = new SystemModules();
40
        $this->additionalSearchFields = [
41
            ['is_deleted', ':', '0'],
42
            ['apps_id', ':', $this->app->getId()],
43
        ];
44
    }
45
46
    /**
47
    * Delete a Record.
48
    *
49
    * @throws Exception
50
    * @return Response
51
    */
52
    public function delete($id): Response
53
    {
54
        return $this->response('Cant delete System Modules at the moment');
55
    }
56
}
57