Passed
Push — master ( 6475c1...2a0745 )
by Maximo
03:27 queued 14s
created

LocalesController::onConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
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\Locales;
8
9
/**
10
 * Class LanguagesController
11
 *
12
 * @package Gewaer\Api\Controllers
13
 *
14
 */
15
class LocalesController extends BaseController
16
{
17
    /*
18
     * fields we accept to create
19
     *
20
     * @var array
21
     */
22
    protected $createFields = ['name'];
23
24
    /*
25
     * fields we accept to create
26
     *
27
     * @var array
28
     */
29
    protected $updateFields = ['name'];
30
31
    /**
32
     * set objects
33
     *
34
     * @return void
35
     */
36 5
    public function onConstruct()
37
    {
38 5
        $this->model = new Locales();
39 5
        $this->additionalSearchFields = [
40
            ['is_deleted', ':', '0'],
41
        ];
42 5
    }
43
}
44