Test Failed
Pull Request — master (#80)
by Maximo
05:46
created

CompaniesCustomFieldsController::onConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gewaer\Api\Controllers;
6
7
use Gewaer\Models\CompaniesCustomFields;
8
9
/**
10
 * Class LanguagesController
11
 *
12
 * @package Gewaer\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 = ['custom_fields_id', 'value'];
24
25
    /*
26
     * fields we accept to create
27
     *
28
     * @var array
29
     */
30
    protected $updateFields = ['custom_fields_id', 'value'];
31
32
    /**
33
     * set objects
34
     *
35
     * @return void
36
     */
37
    public function onConstruct()
38
    {
39
        $this->model = new CompaniesCustomFields();
40
        $this->model->companies_id = $this->userData->currentCompanyId();
41
42
        $this->additionalSearchFields = [
43
            ['companies_id', ':', $this->userData->currentCompanyId()],
44
        ];
45
    }
46
}
47