protected function preDelete() { $comments = CommentDB::getAllOnParentID($this->id); foreach ($comments as $comment) { try { $comment->delete(); } catch (Exception $e) { return false; } } return true; }