/** * * @SWG\Delete( * path="/clean/temperature/{id}", * summary="Deletes the specified temperature. Requires authentication.", * @SWG\Response(response="204", description="Temperature was successfully deleted."), * * ) * @SWG\Delete( * path="/clean/action/{id}", * summary="Deletes the specified action. Requires authentication.", * @SWG\Response(response="204", description="Action was successfully deleted"), * * ) * */ public function actionDelete($resource, $id) { $auth = $this->authenticate(); $this->logAction($auth->getId(), "DELETE /clean/" . $resource . "/" . $id); if (strtolower($resource) == "temperature") { $model = new TemperatureModel($this->context->getService('database.default.context')); $model->delete($id); } if (strtolower($resource) == "login") { $model = new ActionModel($this->context->getService('database.default.context')); $model->delete($id); } }
public function logAction($userId, $action) { $model = new Model\ActionModel($this->context->getService('database.default.context')); $model->logAction($userId, $this->getIpAddressId(), $action); }