コード例 #1
0
ファイル: comment.php プロジェクト: kevinwojo/hubzero-cms
 /**
  * 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();
 }