You are here

function hosting_platform_delete in Hosting 7.4

Same name and namespace in other branches
  1. 5 platform/hosting_platform.module \hosting_platform_delete()
  2. 6.2 platform/hosting_platform.module \hosting_platform_delete()
  3. 7.3 platform/hosting_platform.module \hosting_platform_delete()

Implements hook_delete().

File

platform/hosting_platform.module, line 645
Platform node type definition.

Code

function hosting_platform_delete($node) {
  db_delete('hosting_platform')
    ->condition('nid', $node->nid)
    ->execute();
  db_delete('hosting_package_instance')
    ->condition('rid', $node->nid)
    ->execute();
  hosting_context_delete($node->nid);
  hosting_task_delete_related_tasks($node->nid);
  $result = db_query("SELECT distinct nid FROM {hosting_site} WHERE platform = :platform", array(
    ':platform' => $node->nid,
  ));
  while ($nid = $result
    ->fetch()) {
    node_delete($nid->nid);
  }
}