- $backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
- if (!empty($backend_class)) {
- try {
- $backend_class->delete($item['backend-ref'] ?? '');
- // Delete the photos after they had been deleted successfully
- DBA::delete("photo", ['id' => $photo['id']]);
- } catch (ReferenceStorageException $referenceStorageException) {
- DI::logger()->debug('phot doesn\'t exist.', ['conditions' => $conditions, 'exception' => $referenceStorageException]);
- }
+ try {
+ $backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
+ $backend_class->delete($photo['backend-ref'] ?? '');
+ // Delete the photos after they had been deleted successfully
+ DBA::delete("photo", ['id' => $photo['id']]);
+ } catch (InvalidClassStorageException $storageException) {
+ DI::logger()->debug('Storage class not found.', ['conditions' => $conditions, 'exception' => $storageException]);
+ } catch (ReferenceStorageException $referenceStorageException) {
+ DI::logger()->debug('Photo doesn\'t exist.', ['conditions' => $conditions, 'exception' => $referenceStorageException]);