You are here

function spaces_delete in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces.module \spaces_delete()
  2. 6.3 spaces.module \spaces_delete()
  3. 6.2 spaces.module \spaces_delete()
  4. 7.3 spaces.module \spaces_delete()
  5. 7 spaces.module \spaces_delete()

Deletes a space object's records in the database.

Parameters

$space: The space object to delete.

Return value

Returns TRUE for now.

2 calls to spaces_delete()
spaces_og_nodeapi in spaces_og/spaces_og.module
Implementation of hook_nodeapi().
_spaces_taxonomy_form_delete in spaces_taxonomy/spaces_taxonomy.module
Submit handler for deletion of a space term.

File

./spaces.module, line 1060

Code

function spaces_delete($space) {

  // Remove all features and settings
  db_query("DELETE FROM {spaces} WHERE sid = %d AND type = '%s'", $space->sid, $space->type);
  db_query("DELETE FROM {spaces_features} WHERE sid = %d AND type = '%s'", $space->sid, $space->type);
  db_query("DELETE FROM {spaces_settings} WHERE sid = %d AND type = '%s'", $space->sid, $space->type);

  // Delete the purl modifier
  $modifier = array(
    'provider' => 'spaces_' . $space->type,
    'id' => $space->sid,
  );
  purl_delete($modifier);

  // Allow space type to do its own deleting
  $space
    ->delete();
  return true;
}