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());
    }
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());
    }
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 ( ) ) ; }
Deletes the given term.

@param int $id Term's ID
@return void
Deletes the given term .