| @@ 448-466 (lines=19) @@ | ||
| 445 | * @since 4.9.72.p |
|
| 446 | * @throws RestException |
|
| 447 | */ |
|
| 448 | private function assertSimplifiedSpecifiedOperator() |
|
| 449 | { |
|
| 450 | if (!$this->valueIsSimplifiedSpecifiedOperator() && EED_Core_Rest_Api::debugMode()) { |
|
| 451 | throw new RestException( |
|
| 452 | 'numerically_indexed_array_of_values_only', |
|
| 453 | sprintf( |
|
| 454 | /* translators: 1: variable name*/ |
|
| 455 | esc_html__( |
|
| 456 | 'The array provided for the parameter "%1$s" should be numerically indexed.', |
|
| 457 | 'event_espresso' |
|
| 458 | ), |
|
| 459 | $this->getQueryParamKey() |
|
| 460 | ), |
|
| 461 | array( |
|
| 462 | 'status' => 400, |
|
| 463 | ) |
|
| 464 | ); |
|
| 465 | } |
|
| 466 | } |
|
| 467 | ||
| 468 | /** |
|
| 469 | * If query_param_value were in the simplified specific operator structure, change it into the legacy structure. |
|
| @@ 642-661 (lines=20) @@ | ||
| 639 | * @since 4.9.72.p |
|
| 640 | * @throws RestException |
|
| 641 | */ |
|
| 642 | private function throwInvalidOperatorExceptionIfDebugging() |
|
| 643 | { |
|
| 644 | // so they didn't provide a valid operator |
|
| 645 | if (EED_Core_Rest_Api::debugMode()) { |
|
| 646 | throw new RestException( |
|
| 647 | 'invalid_operator', |
|
| 648 | sprintf( |
|
| 649 | esc_html__( |
|
| 650 | 'You provided an invalid parameter, with key "%1$s" and value "%2$s"', |
|
| 651 | 'event_espresso' |
|
| 652 | ), |
|
| 653 | $this->getQueryParamKey(), |
|
| 654 | $this->getQueryParamValue() |
|
| 655 | ), |
|
| 656 | array( |
|
| 657 | 'status' => 400, |
|
| 658 | ) |
|
| 659 | ); |
|
| 660 | } |
|
| 661 | } |
|
| 662 | ||
| 663 | /** |
|
| 664 | * Returns true if the query_param_key was a logic query parameter, eg `OR`, `AND`, `NOT`, `OR*`, etc. |
|