コード例 #1
0
 /**
  * Delete attachment
  * @param Attachment $attachment
  * @param boolean $flush
  * @return void
  */
 public function deleteAttachment(Attachment $attachment, $flush = false)
 {
     $this->fileStorageService->remove($attachment->getFilename());
     $this->registry->getManager()->remove($attachment);
     if (true === $flush) {
         $this->registry->getManager()->flush();
     }
 }
コード例 #2
0
 /**
  * Delete attachment
  * @param Attachment $attachment
  * @return void
  */
 public function deleteAttachment(Attachment $attachment)
 {
     $this->fileStorageService->remove($attachment->getFilename());
     $this->repository->remove($attachment);
 }