getReceiptPath(); if (null !== $receiptPath) { $absolutePath = sprintf('%s/%s', $this->uploadDir, $receiptPath); if (file_exists($absolutePath)) { unlink($absolutePath); } } $this->entityManager->remove($data); $this->entityManager->flush(); return null; } }