original_string: 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());
      }
code: 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());
      }
code_tokens: 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 ( ) ) ; }
docstring: Permanently deletes the given comment.
  
  @param int $id Comment id
  @return void Redirects to previous page
docstring_tokens: Permanently deletes the given comment .