original_string: public function delete($id)
      {
          $this->loadModel('Taxonomy.Terms');
          $term = $this->Terms->get($id);
          $this->Terms->addBehavior('Tree', ['scope' => ['vocabulary_id' => $term->vocabulary_id]]);
          $this->Terms->removeFromTree($term);
  
          if ($this->Terms->delete($term)) {
              $this->Flash->success(__d('taxonomy', 'Term successfully removed!'));
          } else {
              $this->Flash->danger(__d('taxonomy', 'Term could not be removed, please try again'));
          }
  
          $this->title(__d('taxonomy', 'Delete Term'));
          $this->redirect($this->referer());
      }
code: public function delete($id)
      {
          $this->loadModel('Taxonomy.Terms');
          $term = $this->Terms->get($id);
          $this->Terms->addBehavior('Tree', ['scope' => ['vocabulary_id' => $term->vocabulary_id]]);
          $this->Terms->removeFromTree($term);
  
          if ($this->Terms->delete($term)) {
              $this->Flash->success(__d('taxonomy', 'Term successfully removed!'));
          } else {
              $this->Flash->danger(__d('taxonomy', 'Term could not be removed, please try again'));
          }
  
          $this->title(__d('taxonomy', 'Delete Term'));
          $this->redirect($this->referer());
      }
code_tokens: public function delete ( $ id ) { $ this -> loadModel ( 'Taxonomy.Terms' ) ; $ term = $ this -> Terms -> get ( $ id ) ; $ this -> Terms -> addBehavior ( 'Tree' , [ 'scope' => [ 'vocabulary_id' => $ term -> vocabulary_id ] ] ) ; $ this -> Terms -> removeFromTree ( $ term ) ; if ( $ this -> Terms -> delete ( $ term ) ) { $ this -> Flash -> success ( __d ( 'taxonomy' , 'Term successfully removed!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'taxonomy' , 'Term could not be removed, please try again' ) ) ; } $ this -> title ( __d ( 'taxonomy' , 'Delete Term' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
docstring: Deletes the given term.
  
  @param int $id Term's ID
  @return void
docstring_tokens: Deletes the given term .