FilesystemEntitiesController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 29
rs 10
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 Canvas\Api\Controllers;
6
7
use Canvas\Models\FileSystemEntities;
8
use Canvas\Traits\FileManagementTrait;
9
10
/**
11
 * Class BaseController.
12
 *
13
 * @package Canvas\Api\Controllers
14
 *
15
 * @property Users $userData
16
 * @property Request $request
17
 * @property Config $config
18
 * @property \Baka\Mail\Message $mail
19
 * @property Apps $app
20
 */
21
class FilesystemEntitiesController extends BaseController
22
{
23
    /*
24
        * fields we accept to create
25
        *
26
        * @var array
27
        */
28
    protected $createFields = ['id', 'filesystem_id', 'entity_id', 'system_modules_id', 'companies_id', 'field_name', 'created_at'];
29
30
    /*
31
     * fields we accept to create
32
     *
33
     * @var array
34
     */
35
    protected $updateFields = ['id', 'filesystem_id', 'entity_id', 'system_modules_id', 'companies_id', 'field_name', 'created_at'];
36
37
    /**
38
     * set objects.
39
     *
40
     * @return void
41
     */
42
    public function onConstruct()
43
    {
44
        $this->model = new FileSystemEntities();
0 ignored issues
show
Bug Best Practice introduced by
The property model does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
45
        $this->model->companies_id = $this->userData->currentCompanyId();
46
47
        $this->additionalSearchFields = [
0 ignored issues
show
Bug Best Practice introduced by
The property additionalSearchFields does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
48
            ['is_deleted', ':', '0'],
49
            ['companies_id', ':', $this->userData->currentCompanyId()]
50
        ];
51
    }
52
}
53