return;
}
+ $this->removeFileByObject($internalId, $file);
+ }
+
+ /**
+ * Removes an file by file object.
+ *
+ * @param string $internalId
+ * @param UploadFile $file
+ */
+ private function removeFileByObject($internalId, UploadFile $file) {
$storage = $this->getStorage();
if ($file->isProcessed()) {
/** @var UploadFile $storageFile */
foreach ($storage[$internalId]['files'] as $id => $storageFile) {
- if ($storageFile->getUniqueFileId() === $uniqueFileId) {
+ if ($storageFile->getUniqueFileId() === $file->getUniqueFileId()) {
unset($storage[$internalId]['files'][$id]);
break;
}
/** @var UploadFile $file */
foreach ($files as $file) {
if (!file_exists($file->getLocation())) {
- $this->removeFile($internalId, $file->getUniqueFileId());
+ $this->removeFile($internalId, $file);
}
}