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