/** * Fired before deleting the file. * * @param EntryInterface|FileInterface $entry * @return bool */ public function deleting(EntryInterface $entry) { /** * Make sure the resource exists * and is deleted successfully. */ if ($resource = $entry->resource()) { return $resource->delete(); } return true; }
/** * Fired after deleting the file. * * @param EntryInterface|FileInterface $entry */ public function deleted(EntryInterface $entry) { /** * Make sure the resource exists * and is deleted successfully. */ if ($entry->isForceDeleting() && ($resource = $entry->resource())) { $resource->delete(); } parent::deleted($entry); }