- Rename "facStorage" to "storageManager"
- Fix indentation
- Fix tests
This commit is contained in:
nupplaPhil 2020-01-09 01:48:48 +01:00
parent bfae6766bf
commit 016cfcd846
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 45 additions and 46 deletions

View file

@ -179,7 +179,7 @@ class Photo
}
$data = $i['data'];
} else {
$backendClass = DI::facStorage()->getByName($photo['backend-class'] ?? '');
$backendClass = DI::storageManager()->getByName($photo['backend-class'] ?? '');
$backendRef = $photo['backend-ref'] ?? '';
$data = $backendClass->get($backendRef);
}
@ -272,7 +272,7 @@ class Photo
if (DBA::isResult($existing_photo)) {
$backend_ref = (string)$existing_photo["backend-ref"];
$storage = DI::facStorage()->getByName($existing_photo["backend-class"] ?? '');
$storage = DI::storageManager()->getByName($existing_photo["backend-class"] ?? '');
} else {
$storage = DI::storage();
}
@ -336,7 +336,7 @@ class Photo
$photos = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
foreach($photos as $photo) {
$backend_class = DI::facStorage()->getByName($photo['backend-class'] ?? '');
$backend_class = DI::storageManager()->getByName($photo['backend-class'] ?? '');
if ($backend_class !== null) {
$backend_class->delete($photo["backend-ref"] ?? '');
}
@ -365,7 +365,7 @@ class Photo
$photos = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
foreach($photos as $photo) {
$backend_class = DI::facStorage()->getByName($photo['backend-class'] ?? '');
$backend_class = DI::storageManager()->getByName($photo['backend-class'] ?? '');
if ($backend_class !== null) {
$fields["backend-ref"] = $backend_class->put($img->asString(), $photo['backend-ref']);
} else {