public function __construct(DocumentManager $dm, $class) { $this->dm = $dm; $this->repository = $dm->getRepository($class); $metadata = $dm->getClassMetadata($class); $this->class = $metadata->name; }
/** * {@inheritDoc} */ public function delete(CategoryInterface $category) { $this->em->remove($category); $this->em->flush(); }