TagQuery   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A hasTags() 0 10 2
1
<?php
2
/**
3
 * Date: 12.02.2015
4
 * Time: 22:33 ч.
5
 */
6
7
namespace nkostadinov\taxonomy\behaviors;
8
9
use nkostadinov\taxonomy\models\TaxonomyTerms;
10
11
class TagQuery extends BaseTermBehavior
12
{
13
    /**
14
     * @param array $tags
15
     * @return \yii\base\Component
16
     */
17
    public function hasTags($tags = [])
18
    {
19
        $this->joinTables();
20
21
        if(!empty($tags))
22
            $this->getQuery()
23
                ->andFilterWhere([ TaxonomyTerms::tableName() . '.term' => $tags ]);
24
25
        return $this->getQuery();
26
    }
27
28
29
}