loadController('execution', 'view'); $control->view($executionID); $data = $this->getData(); $execution = $data->data->execution; $this->send(200, $execution); } public function put($executionID) { $oldExecution = $this->loadModel('execution')->getByID($executionID); /* Set $_POST variables. */ $fields = 'project,code,name,begin,end,lifetime,desc,days,acl'; $this->batchSetPost($fields, $oldExecution); $this->setPost('whitelist', $this->request('whitelist', explode(',', $oldExecution->whitelist))); $control = $this->loadController('execution', 'edit'); $control->edit($executionID); $data = $this->getData(); if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); if(!isset($data->result)) return $this->sendError(400, 'error'); $execution = $this->execution->getByID($executionID); $this->sendSuccess(200, $execution); } public function delete($executionID) { $control = $this->loadController('execution', 'delete'); $control->delete($executionID, 'true'); $this->getData(); $this->sendSuccess(200, 'success'); } }