You are here

function hosting_site_delete in Hostmaster (Aegir) 6

Implementation of hook_delete().

File

modules/hosting/site/hosting_site.nodeapi.inc, line 120
Site nodeapi implementations.

Code

function hosting_site_delete($node) {
  hosting_ip_delete($node);
  db_query('DELETE FROM {hosting_site} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {hosting_package_instance} WHERE rid=%d', $node->nid);
  hosting_context_delete($node->nid);
  $result = db_query("SELECT distinct nid FROM {hosting_task} WHERE rid=%d", $node->nid);
  while ($nid = db_fetch_object($result)) {
    node_delete($nid->nid);
  }
}