/** * post call * * call _post_{methodName}_{extension} if exists with the composed and * serialized (applying the repose format) response data * * @example _post_get_json */ protected function postCall() { $postCall = '_post_' . $this->apiMethodInfo->methodName . '_' . $this->responseFormat->getExtension(); if (method_exists($this->apiClassInstance, $postCall)) { $this->dispatch('postCall'); $this->responseData = call_user_func(array($this->apiClassInstance, $postCall), $this->responseData); } }
/** * post call * * call _post_{methodName}_{extension} if exists with the composed and * serialized (applying the repose format) response data * * @example _post_get_json */ protected function postCall() { $o =& $this->apiMethodInfo; $postCall = '_post_' . $o->methodName . '_' . $this->responseFormat->getExtension(); if (method_exists($o->className, $postCall)) { $this->dispatch('postCall'); $this->responseData = call_user_func(array(Scope::get($o->className), $postCall), $this->responseData); } }
/** * Parses the request data and returns it * * @return array php data */ public function getRequestData() { if ($this->requestMethod == 'PUT' || $this->requestMethod == 'PATCH' || $this->requestMethod == 'POST') { if (!empty($this->requestData)) { return $this->requestData; } try { $r = file_get_contents('php://input'); if (is_null($r)) { return array(); } $r = $this->requestFormat->decode($r); return is_null($r) ? array() : $r; } catch (RestException $e) { $this->handleError($e->getCode(), $e->getMessage()); } } return array(); }