Ejemplo n.º 1
0
 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]);
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public function delete($dados)
 {
     $obj = new PostModel();
     $obj->Id = $dados['id'];
     return $obj->delete();
 }