public function SaveAction()
 {
     $id = $this->getRequest()->getPost('id');
     $uri = $this->getRequest()->getPost('uri');
     $timeout = $this->getRequest()->getPost('timeout');
     $response_body = $this->getRequest()->getPost('response_body');
     $response_status_code = $this->getRequest()->getPost('response_status_code');
     $request_query_key = $this->getRequest()->getPost('request_query_key');
     $request_query_value = $this->getRequest()->getPost('request_query_value');
     $request_post_key = $this->getRequest()->getPost('request_post_key');
     $request_post_value = $this->getRequest()->getPost('request_post_value');
     $response_header_key = $this->getRequest()->getPost('response_header_key');
     $response_header_value = $this->getRequest()->getPost('response_header_value');
     $Mock = new \Service\Mock();
     $Mock->query($id);
     $Mock->filterOwner();
     $Mock->setUri($uri);
     $Mock->setRequestQueryByKeyAndValue($request_query_key, $request_query_value);
     $Mock->setRequestPostByKeyAndValue($request_post_key, $request_post_value);
     $Mock->setResponseHeaderByKeyAndValue($response_header_key, $response_header_value);
     $Mock->setResponseBody($response_body);
     $Mock->setResponseStatusCode($response_status_code);
     $Mock->setTimeout($timeout);
     $Mock->save();
     $ServiceGenerator = new \Service\Mock\Generator($Mock->getUriId());
     $ServiceGenerator->generate();
     $this->getView()->displayAjax("Save Successfully.");
 }
Beispiel #2
0
 public function UpdateAction()
 {
     $id = intval($this->getRequest()->getQuery('id'));
     $Mock = new \Service\Mock();
     $Mock->query($id);
     $Mock->filterOwner();
     $this->getView()->assign('response_header', $Mock->getResponseHeader());
     $this->getView()->assign('response_body', $Mock->getResponseBody());
     $this->getView()->assign('response_status_code', $Mock->getResponseStatusCode());
     $this->getView()->assign('request_query', $Mock->getRequestQuery());
     $this->getView()->assign('request_post', $Mock->getRequestPost());
     $this->getView()->assign('id', $Mock->getId());
     $this->getView()->assign('uri_id', $Mock->getUriId());
     $this->getView()->assign('uri', $Mock->getUri());
     $this->getView()->assign('timeout', $Mock->getTimeout());
     $this->getView()->display('mock/update.html');
 }