public function updateStorage($batchSize = 100) { $images = $this->getImageRepository()->findImagesForStorageUpdate($batchSize); foreach ($images as $image) { $this->updateImage($image); } $this->em->flush(); }