public function deleteAction() { if (!isset($_POST['postId'])) { return json_encode(["error" => "postId missing"]); } $postId = $_POST['postId']; PostModel::delete($this->pdo, $postId); return json_encode(["message" => "Supprimé !", "postId" => $postId]); }
/** * delete * * Delete attachment by id * * @param int $attachment_id ID of attachment */ public function delete($attachment_id) { try { $postBO = $this->get($attachment_id); if (isset($postBO->attached_file) && $postBO->attached_file != "") { Utils::deleteFile($postBO->attached_file); } if (parent::delete($attachment_id)) { return TRUE; } } catch (Exception $e) { } return FALSE; }
public function delete($post_id) { try { $internalflightBO = $this->get($post_id); if ($internalflightBO != NULL) { if (parent::delete($post_id)) { if (isset($internalflightBO->city_id)) { $this->deleteRelationship($post_id, $internalflightBO->city_id); } if (isset($internalflightBO->country_id)) { $this->deleteRelationship($post_id, $internalflightBO->country_id); } if (isset($internalflightBO->image_id)) { Model::autoloadModel("image"); $imageModel = new ImageModel($this->db); $imageModel->delete($internalflightBO->image_id); } return TRUE; } } } catch (Exception $e) { } return FALSE; }
public function delete($dados) { $obj = new PostModel(); $obj->Id = $dados['id']; return $obj->delete(); }