Test Failed
Pull Request — master (#54)
by Rafael
05:26
created

PermissionsResourcesController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 29
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A onConstruct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Api\Controllers;
6
7
use Gewaer\Models\Resources;
8
9
/**
10
 * Class AclResourcesController
11
 *
12
 * @package Gewaer\Api\Controllers
13
 *
14
 * @property Users $userData
15
 * @property Apps $app
16
 */
17
class PermissionsResourcesController extends BaseController
18
{
19
    /*
20
     * fields we accept to create
21
     *
22
     * @var array
23
     */
24
    protected $createFields = [];
25
26
    /*
27
     * fields we accept to create
28
     *
29
     * @var array
30
     */
31
    protected $updateFields = [];
32
33
    /**
34
     * set objects
35
     *
36
     * @return void
37
     */
38 2
    public function onConstruct()
39
    {
40 2
        $this->model = new Resources();
41
42
        //get the list of roes for the systema + my company
43 2
        $this->additionalSearchFields = [
44 2
            ['is_deleted', ':', '0'],
45 2
            ['apps_id', ':', '0|' . $this->app->getId()],
46
        ];
47 2
    }
48
}
49