src/Sulu/Bundle/TagBundle/Tag/TagManager.php
public function delete($id)
    {
        $tag = $this->tagRepository->findTagById($id);

        if (!$tag) {
            throw new TagNotFoundException($id);
        }

        $this->em->remove($tag);
        $this->em->flush();

        // throw an tag.delete event
        $event = new TagDeleteEvent($tag);
        $this->eventDispatcher->dispatch(TagEvents::TAG_DELETE, $event);
    }
public function delete($id)
    {
        $tag = $this->tagRepository->findTagById($id);

        if (!$tag) {
            throw new TagNotFoundException($id);
        }

        $this->em->remove($tag);
        $this->em->flush();

        // throw an tag.delete event
        $event = new TagDeleteEvent($tag);
        $this->eventDispatcher->dispatch(TagEvents::TAG_DELETE, $event);
    }
public function delete ( $ id ) { $ tag = $ this -> tagRepository -> findTagById ( $ id ) ; if ( ! $ tag ) { throw new TagNotFoundException ( $ id ) ; } $ this -> em -> remove ( $ tag ) ; $ this -> em -> flush ( ) ; // throw an tag.delete event $ event = new TagDeleteEvent ( $ tag ) ; $ this -> eventDispatcher -> dispatch ( TagEvents :: TAG_DELETE , $ event ) ; }
Deletes the given Tag.

@param number $id The tag to delete

@throws Exception\TagNotFoundException
Deletes the given Tag .