You are here

function hosting_platform_post_hosting_delete_task in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 platform/hosting_platform.drush.inc \hosting_platform_post_hosting_delete_task()
  2. 7.3 platform/hosting_platform.drush.inc \hosting_platform_post_hosting_delete_task()

Implements hook_post_hosting_TASK_TYPE_task().

File

platform/hosting_platform.drush.inc, line 164
Implement drush hooks for the Platforms module.

Code

function hosting_platform_post_hosting_delete_task($task, $data) {
  if ($task->ref->type != 'platform') {
    return;
  }
  $task->ref->platform_status = HOSTING_PLATFORM_DELETED;
  $task->ref->no_verify = TRUE;
  node_save($task->ref);
  hosting_context_delete($task->ref->nid);
  db_delete('hosting_platform_client_access')
    ->condition('pid', $task->ref->nid)
    ->execute();

  // Clean up package instances.
  hosting_package_instance_sync($task->ref->nid, 'platform');
}