Пример #1
0
 /**
  * Delete the record and all associated data
  *
  * @return  boolean  False if error, True on success
  */
 public function destroy()
 {
     // Can't delete what doesn't exist
     if (!$this->get('id')) {
         return true;
     }
     // Remove comments
     foreach ($this->replies()->rows() as $comment) {
         if (!$comment->destroy()) {
             $this->addError($comment->getError());
             return false;
         }
     }
     return parent::delete();
 }