Argument::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 3
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
namespace samsonframework\orm;
3
4
/**
5
 * Database query condition argument.
6
 *
7
 * @author Vitaly Iegorov <[email protected]>
8
 */
9
class Argument implements ArgumentInterface
10
{
11
    /** @var string Argument field name */
12
    public $field = '';
13
14
    /** @var string Argument field value */
15
    public $value;
16
17
    /** @var string Argument relation between field and its value */
18
    public $relation = ArgumentInterface::EQUAL;
19
20
    /**
21
     * Constructor
22
     * @param string $field Argument field name
23
     * @param mixed $value Argument field value
24
     * @param string $relation Argument relation between field and its value
25
     * @see \samson\activerecord\Argument:relation
26
     */
27
    public function __construct($field, $value, $relation = ArgumentInterface::EQUAL)
28
    {
29
        $this->field = $field;
30
        $this->value = $value;
31
        $this->relation = !isset($relation) ? ArgumentInterface::EQUAL : $relation;
32
    }
33
}
34