public function cacheThumbnails($limit) { $clips = $this->clipDao->getUncachedThumbsClipsList($limit); if (!$clips) { return true; } foreach ($clips as $clip) { $prov = new VideoProviders($clip->code); if (!$clip->provider) { $clip->provider = $prov->detectProvider(); } $thumbUrl = $prov->getProviderThumbUrl($clip->provider); if ($thumbUrl != VideoProviders::PROVIDER_UNDEFINED) { $clip->thumbUrl = $thumbUrl; } $clip->thumbCheckStamp = time(); $this->clipDao->save($clip); } return true; }