Condition   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getExpression() 0 4 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