/** * @param SearchKeysQuery $query */ public function handle(SearchKeysQuery $query) { $serverConfig = $this->serversConfig->getServerConfig($query->getServerKey()); $connection = new ServerConnection($serverConfig); $manager = new ServerManager($connection); $limit = $this->getValidLimit($query->getLimit()); $searchPattern = $query->getSearchPattern() ?: '*'; $manager->selectDatabase($query->getDatabase()); $keyInfoObjects = $manager->getKeyInfoObjects($searchPattern, $limit); $page = new TwigPage('Includes/KeyList.twig', ['appConfig' => $this->appConfig, 'keyInfoObjects' => $keyInfoObjects, 'database' => $query->getDatabase(), 'serverKey' => $query->getServerKey()]); $page->respond(); }