You are here

public function BoxCustom::delete in Boxes 7.2

Delete the record from the database.

File

boxes_admin_ui/plugins/custom.inc, line 15
Box ctools plugin

Class

BoxCustom
DO NOT USE THIS BOX. ONLY USED FOR THE UI PLUGINS

Code

public function delete() {

  // Delete all boxes belonging to this box type if we are removing
  // the actual box.
  if ($this
    ->getExportStatus() == 'Normal') {
    db_delete('box')
      ->condition('type', $this->type)
      ->execute();
  }
  db_delete('box_type')
    ->condition('name', $this->type)
    ->execute();
  field_attach_delete_bundle('box', $this->type);
  drupal_flush_all_caches();
}