function delete()
 {
     $fields = DynamicFormField::objects()->filter(array('type' => 'list-' . $this->id))->count();
     if ($fields == 0) {
         return parent::delete();
     } else {
         // Refuse to delete lists that are in use by fields
         return false;
     }
 }
 function delete()
 {
     foreach ($this->getAnswers() as $a) {
         $a->delete();
     }
     return parent::delete();
 }
Beispiel #3
0
 function delete()
 {
     // Statuses with tickets are not deletable
     if (!$this->isDeletable()) {
         return false;
     }
     return parent::delete();
 }
Beispiel #4
0
 function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     // Allow the field to cleanup anything else in the database
     $this->getField()->db_cleanup();
     return true;
 }