id) { throw new WebserviceException( 'Invalid order ID, order does not exist', [self::DEFAULT_ERROR_CODE, 404] ); } return OrderPayloadService::buildPayload($order); } /** * Fetch order IDs for a given time range. * * @param $queryParams * @throws \WebserviceException */ public function getObjectsByTimeRange() { $this->records = $this->getTimeRangeRecords('id_order'); $cursorValue = $this->getCursorValue(); $returnRecords = $this->buildTimeRangeReturnRecords( 'Order', 'id_order', 'KlaviyoPs\Classes\BusinessLogicServices\OrderPayloadService' ); return $this->buildTimeRangeResultsPayload($returnRecords, $cursorValue); } }