/** * {@inheritDoc} * * @param string $documentId id of entity to delete * * @return null|Object */ public function deleteRecord($documentId) { $manager = $this->repository->getDocumentManager(); $entity = $this->find($documentId); $return = $entity; if ($entity) { $manager->remove($entity); $manager->flush(); $return = null; } return $return; }