public function delete($id)
    {
        $item = $this->itemRepository->findById($id);

        if (!$item) {
            throw new ItemNotFoundException($id);
        }

        $this->em->remove($item);
        $this->em->flush();
    }
public function delete($id)
    {
        $item = $this->itemRepository->findById($id);

        if (!$item) {
            throw new ItemNotFoundException($id);
        }

        $this->em->remove($item);
        $this->em->flush();
    }
public function delete ( $ id ) { $ item = $ this -> itemRepository -> findById ( $ id ) ; if ( ! $ item ) { throw new ItemNotFoundException ( $ id ) ; } $ this -> em -> remove ( $ item ) ; $ this -> em -> flush ( ) ; }
Deletes an item.

@param int $id

@throws Exception\ItemNotFoundException
Deletes an item .