public function deleteDocumentPSEAssociations(FileDeleteEvent $event) { $model = $event->getFileToDelete(); if ($model instanceof ProductDocument) { $model->getProductSaleElementsProductDocuments()->delete(); } }
/** * Deleting file in the database and in storage * * @param FileDeleteEvent $event Image event */ public function deleteFile(FileDeleteEvent $event) { $this->fileManager->deleteFile($event->getFileToDelete()); }
/** * Get Document about to be deleted * * @return CategoryDocument|ProductDocument|ContentDocument|FolderDocument * @deprecated deprecated since version 2.0.3. Use FileDeleteEvent instead */ public function getDocumentToDelete() { return parent::getFileToDelete(); }
/** * Get Image about to be deleted * * @return CategoryImage|ProductImage|ContentImage|FolderImage * @deprecated deprecated since version 2.0.3. Use FileDeleteEvent instead */ public function getImageToDelete() { return parent::getFileToDelete(); }