Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | function build() { |
||
19 | $params = array(); |
||
20 | if ($this->value !== null) { |
||
21 | $op = $this->operator ? $this->operator : '='; |
||
22 | $paramName = str_replace('.', '_', $this->key); |
||
23 | $sql = "{$this->key} $op :{$paramName}"; |
||
24 | $params[":{$paramName}"] = $this->value; |
||
25 | } else { |
||
26 | $sql = $sql = "{$this->key} IS NULL "; |
||
27 | } |
||
28 | return array($sql, $params); |
||
29 | } |
||
30 | } |
||
31 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.