Completed
Push — master ( 41fafc...54e7a7 )
by Andrii
07:29
created

HashCondition::__construct()   A

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 1
crap 1
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db\conditions;
9
10
/**
11
 * Condition based on column-value pairs.
12
 *
13
 * @author Dmytro Naumenko <[email protected]>
14
 * @since 2.0.14
15
 */
16
class HashCondition implements ConditionInterface
17
{
18
    /**
19
     * @var array|null the condition specification.
20
     */
21
    private $hash;
22
23
24
    /**
25
     * HashCondition constructor.
26
     *
27
     * @param array|null $hash
28
     */
29 3
    public function __construct($hash)
30
    {
31 3
        $this->hash = $hash;
32
    }
33
34
    /**
35
     * @return array|null
36
     */
37 3
    public function getHash()
38
    {
39 3
        return $this->hash;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public static function fromArrayDefinition($operator, $operands)
46
    {
47
        return new static($operands);
48
    }
49
}
50