environmentRepository->find($id) : null; if (null === $environment) { throw new NotFoundHttpException(sprintf('Environment "%s" not found.', $id)); } $databaseName = $environment->getDatabaseName(); if (null === $databaseName || '' === $databaseName) { throw new NotFoundHttpException('No database configured for this environment.'); } $info = $this->databaseService->getDatabaseInfo($databaseName); $dto = new DatabaseInfo(); $dto->connected = $info['connected']; $dto->name = $info['name']; $dto->size = $info['size']; $dto->tableCount = $info['tableCount']; $dto->activeConnections = $info['activeConnections']; $dto->cacheHitRatio = $info['cacheHitRatio']; $dto->largestTable = $info['largestTable']; return $dto; } }