public function remove(ResourceInterface $resource) { if (null !== $this->find($resource->getId())) { $this->_em->remove($resource); $this->_em->flush(); } }