Completed
Pull Request — master (#1)
by Angel
07:01
created

FieldResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A baseQuery() 0 3 1
1
<?php
2
3
namespace roaresearch\yii2\formgenerator\roa\resources;
4
5
use roaresearch\yii2\formgenerator\roa\models\Field;
6
use roaresearch\yii2\formgenerator\roa\models\FieldSearch;
7
use yii\db\ActiveQuery;
8
9
/**
10
 * CRUD resource for `Field` records
11
 * @author Angel (Faryshta) Guevara <[email protected]>
12
 */
13
class FieldResource extends \roaresearch\yii2\roa\controllers\Resource
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public $modelClass = Field::class;
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public $searchClass = FieldSearch::class;
24
25
    /**
26
     * @inheritdoc
27
     */
28 5
    public function baseQuery(): ActiveQuery
29
    {
30 5
        return parent::baseQuery()->alias('field')->with(['dataType']);
31
    }
32
}
33