@@ 322-324 (lines=3) @@ | ||
319 | } |
|
320 | // Unary operators need a single value. |
|
321 | else if (!empty($operator) && $this->isUnaryOperator($operator)) { |
|
322 | if (empty($value) || count($value) > 1) { |
|
323 | throw new Error(sprintf("Unary operators must be associated with a single value (field '%s').", $field)); |
|
324 | } |
|
325 | ||
326 | // Pick the first item from the values. |
|
327 | $value = reset($value); |
|
@@ 331-333 (lines=3) @@ | ||
328 | } |
|
329 | // Range operators need exactly two values. |
|
330 | else if (!empty($operator) && $this->isRangeOperator($operator)) { |
|
331 | if (empty($value) || count($value) !== 2) { |
|
332 | throw new Error(sprintf("Range operators must require exactly two values (field '%s').", $field)); |
|
333 | } |
|
334 | } |
|
335 | // Null operators can't have a value set. |
|
336 | else if (!empty($operator) && $this->isNullOperator($operator)) { |