public function checkDeploy(GetResponseEvent $event) { if (null === $this->cache || $this->cache->contains(self::CHECK_DEPLOY_KEY)) { return; } $clients = $this->clientRepository->countClients(); $cities = $this->cityRepository->countCities(); $hasDefaultClient = $this->clientRepository->findOneByUid($this->defaultClientUid) instanceof Client; if ($clients <= 0 || $cities <= 0 || !$hasDefaultClient) { $this->cache->delete(self::CHECK_DEPLOY_KEY); throw new \RuntimeException('Make sure you did run the populate database command.'); } else { $this->cache->save(self::CHECK_DEPLOY_KEY, true); } }