@@ 349-351 (lines=3) @@ | ||
346 | } |
|
347 | // Unary operators need a single value. |
|
348 | else if (!empty($operator) && $this->isUnaryOperator($operator)) { |
|
349 | if (empty($value) || count($value) > 1) { |
|
350 | throw new Error(sprintf("Unary operators must be associated with a single value (field '%s').", $field)); |
|
351 | } |
|
352 | ||
353 | // Pick the first item from the values. |
|
354 | $value = reset($value); |
|
@@ 358-360 (lines=3) @@ | ||
355 | } |
|
356 | // Range operators need exactly two values. |
|
357 | else if (!empty($operator) && $this->isRangeOperator($operator)) { |
|
358 | if (empty($value) || count($value) !== 2) { |
|
359 | throw new Error(sprintf("Range operators must require exactly two values (field '%s').", $field)); |
|
360 | } |
|
361 | } |
|
362 | // Null operators can't have a value set. |
|
363 | else if (!empty($operator) && $this->isNullOperator($operator)) { |