Completed
Branch 2.0 (acba87)
by Vermeulen
02:20
created

WhereList::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BfwSql\Queries\Parts;
4
5
class WhereList extends CommonList
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    protected $partPrefix = 'WHERE';
11
    
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected $separator = ' AND ';
16
    
17
    /**
18
     * Magic method __invoke, used when the user call object like a function
19
     * @link http://php.net/manual/en/language.oop5.magic.php#object.invoke
20
     * 
21
     * @param string $expr The expression
22
     * @param array|null $preparedParams (default: null) params to use for this
23
     *  expression in case of prepared request.
24
     * 
25
     * @return void
26
     */
27
    public function __invoke(string $expr, $preparedParams = null)
28
    {
29
        parent::__invoke($expr);
30
        
31
        if ($preparedParams !== null) {
32
            $this->querySystem->addPreparedParams($preparedParams);
33
        }
34
    }
35
}
36