getOption('connection'); $connection = ConnectionManager::get($connectionName); if (!method_exists($connection, 'getSchemaCollection')) { $msg = sprintf( 'The "%s" connection is not compatible with orm caching, ' . 'as it does not implement a "getSchemaCollection()" method.', $connectionName ); $output->writeln('' . $msg . ''); return null; } $config = $connection->config(); if (empty($config['cacheMetadata'])) { $output->writeln('Metadata cache was disabled in config. Enable to cache or clear.'); return null; } $connection->cacheMetadata(true); return $connection->getSchemaCollection(); } }