Conditions | 4 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function apply(Builder $query, $value = null) |
||
31 | { |
||
32 | // Set the Query |
||
33 | $this->setQuery($query); |
||
34 | |||
35 | // Remove whitespace from the value |
||
36 | if (is_string($value)) { |
||
37 | $value = trim($value); |
||
38 | } |
||
39 | |||
40 | // Determine if the the ID's are a comma or space separated list |
||
41 | // if true, add where clause looking for an array of ID's |
||
42 | if (is_string($value) && $ids = (new StringHelpers($value))->isListString()) { |
||
43 | $this->query = $this->arrayValueClause($ids); |
||
44 | } |
||
45 | |||
46 | // Add where clause searching for a single Plan ID |
||
47 | else { |
||
48 | $this->query = $this->stringValueClause($value); |
||
49 | } |
||
50 | |||
51 | return $this->query; |
||
52 | } |
||
90 |