PropertyResource::baseQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace roaresearch\yii2\formgenerator\roa\resources\field\rule;
4
5
use roaresearch\yii2\formgenerator\roa\models\FieldRuleProperty;
6
use roaresearch\yii2\formgenerator\roa\models\FieldRulePropertySearch;
7
use yii\db\ActiveQuery;
8
9
/**
10
 * CRUD resource for `FieldRuleProperty` records
11
 * @author Angel (Faryshta) Guevara <[email protected]>
12
 */
13
class PropertyResource extends \roaresearch\yii2\roa\controllers\Resource
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public $idAttribute = 'property';
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public $modelClass = FieldRuleProperty::class;
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public $searchClass = FieldRulePropertySearch::class;
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public $filterParams = ['field_id', 'rule_id'];
34
35
    /**
36
     * @inheritdoc
37
     */
38 3
    public function baseQuery(): ActiveQuery
39
    {
40 3
        return parent::baseQuery()->innerJoinWith(['rule']);
41
    }
42
}
43