$object->delete

(unknown)

$object->delete -- Delete a record

Description

boolean $object->delete (void)

Minimum version: Midgard 1.4 (Bifrost)

Is used to delete the record represented by the object. The object must first be instantiated by a call to either mgd_get_XXX() or mgd_list_XXX().

An object cannot be deleted if it has dependants: parameters, attachments or reply articles, for example. Delete those first or use the mgd_delete_XXX_tree() functions, where appropriate.

Returns TRUE on success, FALSE on failure.


<?php
  $article = mgd_get_topic(123); // topic with id 123 will be deleted soon.
  if($article->delete()) {
    echo "Deleted article.<br>\n";
  } else {
    echo "Failed to delete article.<br>\n";
    echo "Reason: " . mgd_errstr();
  }
?>

Method available for: article, attachment, element, event, event_member, group, host, member, page, pageelement, pagelink, person, preference, sitegroup, snippet, snippetdir, style and topic objects.