CompaniesCustomFieldsController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A onConstruct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Api\Controllers;
6
7
use Canvas\Models\CompaniesCustomFields;
8
9
/**
10
 * Class LanguagesController.
11
 *
12
 * @package Canvas\Api\Controllers
13
 * @property Users $userData
14
 *
15
 */
16
class CompaniesCustomFieldsController extends BaseController
17
{
18
    /*
19
     * fields we accept to create
20
     *
21
     * @var array
22
     */
23
    protected $createFields = [
24
        'custom_fields_id',
25
        'value'
26
    ];
27
28
    /*
29
     * fields we accept to create
30
     *
31
     * @var array
32
     */
33
    protected $updateFields = [
34
        'custom_fields_id',
35
        'value'
36
    ];
37
38
    /**
39
     * set objects.
40
     *
41
     * @return void
42
     */
43
    public function onConstruct()
44
    {
45
        $this->model = new CompaniesCustomFields();
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...
46
        $this->model->companies_id = $this->userData->currentCompanyId();
47
48
        $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...
49
            ['companies_id', ':', $this->userData->currentCompanyId()],
50
        ];
51
    }
52
}
53