OrCondition::getString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Nip\Database\Query\Condition;
4
5
/**
6
 * Class OrCondition
7
 * @package Nip\Database\Query\Condition
8
 */
9
class OrCondition extends Condition
10 4
{
11
    protected $_condition;
12 4
    protected $_orCondition;
13 4
14 4
    /**
15
     * OrCondition constructor.
16 4
     * @param $condition
17
     * @param $orCondition
18 4
     */
19
    public function __construct($condition, $orCondition)
20
    {
21
        $this->_condition = $condition;
22
        $this->_orCondition = $orCondition;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getString()
29
    {
30
        return $this->protectCondition($this->_condition->getString()) . ' OR ' . $this->protectCondition($this->_orCondition->getString()) . '';
31
    }
32
}
33