Completed
Push — master ( c22208...64acfb )
by Igor
04:17
created

RegionQuery::like()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace app\models\query;
4
5
use Yii;
6
use yii\db\ActiveQuery;
7
8
/**
9
 * ActiveQuery for Region
10
 */
11
class RegionQuery extends ActiveQuery
12
{
13
    /**
14
     * `Like` search for value in the field
15
     *
16
     * @param string $field
17
     * @param string $value
18
     * @return yii\db\ActiveQuery
19
     */
20
    public function like($field, $value)
21
    {
22
        $this->andWhere(['like', $field, $value]);
23
        return $this;
24
    }
25
}
26