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

SystemModulesController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 39
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onConstruct() 0 6 1
A delete() 0 3 1
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