Condition::getExpression()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @link https://github.com/vuongxuongminh/yii2-searchable
4
 * @copyright Copyright (c) 2019 Vuong Xuong Minh
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace vxm\searchable\expression;
9
10
use yii\db\conditions\InCondition;
11
use yii\db\ExpressionInterface;
12
13
/**
14
 * Class Condition provide searchable condition have been ensured table alias.
15
 *
16
 * @author Vuong Minh <[email protected]>
17
 * @since 1.0.0
18
 */
19
class Condition extends Expression
20
{
21
22
    /**
23
     * @inheritDoc
24
     */
25 4
    public function getExpression(): ExpressionInterface
26
    {
27 4
        return new InCondition($this->searchableKey(), 'IN', $this->ids);
28
    }
29
30
}
31