public function delete($id)
    {
        $this->loadModel('Comment.Comments');
        $comment = $this->Comments
            ->find()
            ->where(['Comments.id' => $id, 'Comments.table_alias' => $this->_manageTable])
            ->first();

        if ($comment) {
            if ($this->Comments->delete($comment)) {
                $this->Flash->success(__d('comment', 'Comment was successfully deleted!'));
            } else {
                $this->Flash->danger(__d('comment', 'Comment could not be deleted, please try again.'));
            }
        } else {
            $this->Flash->danger(__d('comment', 'Invalid comment, comment was not found.'));
        }

        $this->title(__d('comment', 'Delete Comment'));
        $this->redirect($this->referer());
    }
public function delete($id)
    {
        $this->loadModel('Comment.Comments');
        $comment = $this->Comments
            ->find()
            ->where(['Comments.id' => $id, 'Comments.table_alias' => $this->_manageTable])
            ->first();

        if ($comment) {
            if ($this->Comments->delete($comment)) {
                $this->Flash->success(__d('comment', 'Comment was successfully deleted!'));
            } else {
                $this->Flash->danger(__d('comment', 'Comment could not be deleted, please try again.'));
            }
        } else {
            $this->Flash->danger(__d('comment', 'Invalid comment, comment was not found.'));
        }

        $this->title(__d('comment', 'Delete Comment'));
        $this->redirect($this->referer());
    }
public function delete ( $ id ) { $ this -> loadModel ( 'Comment.Comments' ) ; $ comment = $ this -> Comments -> find ( ) -> where ( [ 'Comments.id' => $ id , 'Comments.table_alias' => $ this -> _manageTable ] ) -> first ( ) ; if ( $ comment ) { if ( $ this -> Comments -> delete ( $ comment ) ) { $ this -> Flash -> success ( __d ( 'comment' , 'Comment was successfully deleted!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'comment' , 'Comment could not be deleted, please try again.' ) ) ; } } else { $ this -> Flash -> danger ( __d ( 'comment' , 'Invalid comment, comment was not found.' ) ) ; } $ this -> title ( __d ( 'comment' , 'Delete Comment' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Permanently deletes the given comment.

@param int $id Comment id
@return void Redirects to previous page
Permanently deletes the given comment .