PostQuery::category()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace zacksleo\yii2\cms\models\queries;
4
5
use yii\db\ActiveQuery;
6
use creocoder\taggable\TaggableQueryBehavior;
7
8
/**
9
 * Class PostQuery
10
 * @package zacksleo\yii2\cms\models
11
 * @author zacksleo <[email protected]>
12
 */
13
class PostQuery extends ActiveQuery
14
{
15
    public function behaviors()
16
    {
17
        return [
18
            TaggableQueryBehavior::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
19
        ];
20
    }
21
22
    public function category($id)
23
    {
24
        return $this->andFilterWhere(['like', 'categories', ",$id,"]);
25
    }
26
}
27