entityManager ->getRepository(Teamer::class) ->createQueryBuilder('t') ->select('t.id', 'p.filename') ->innerJoin('t.photo', 'p') ->getQuery() ->getArrayResult() ; $imagesCount = count($images); $io->info('Generating thumbnails for '.$imagesCount.' profile images...'); $progressbar = $io->createProgressBar($imagesCount); $progressbar->start(); foreach ($images as $image) { try { $this->filterService->warmUpCache($image['filename'], 'thumbnail'); $this->filterService->warmUpCache($image['filename'], 'profile'); $this->cacheManager->getBrowserPath($image['filename'], 'thumbnail'); $this->cacheManager->getBrowserPath($image['filename'], 'profile'); } catch (\Exception $e) { } $progressbar->advance(); } $progressbar->finish(); return Command::SUCCESS; } }