protected function resolveDatabaseImportCommand($service = null)
    {
        /** @var ServiceDbInterface $instance */
        $instance = $this->resolveDatabaseServiceInstance($service);

        /** @var DatabaseInterface $database */
        $database = $this->getDatabaseInfo($instance);

        switch ($database->getProtocol()) {
            case 'mysql':
                return (new MysqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
            case 'pgsql':
                return (new PgsqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
        }
    }
protected function resolveDatabaseImportCommand($service = null)
    {
        /** @var ServiceDbInterface $instance */
        $instance = $this->resolveDatabaseServiceInstance($service);

        /** @var DatabaseInterface $database */
        $database = $this->getDatabaseInfo($instance);

        switch ($database->getProtocol()) {
            case 'mysql':
                return (new MysqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
            case 'pgsql':
                return (new PgsqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
        }
    }
protected function resolveDatabaseImportCommand ( $ service = null ) { /** @var ServiceDbInterface $instance */ $ instance = $ this -> resolveDatabaseServiceInstance ( $ service ) ; /** @var DatabaseInterface $database */ $ database = $ this -> getDatabaseInfo ( $ instance ) ; switch ( $ database -> getProtocol ( ) ) { case 'mysql' : return ( new MysqlCommand ( ) ) -> host ( $ database -> getHostname ( ) ) -> username ( $ database -> getUser ( ) ) -> password ( $ database -> getPassword ( ) ) -> database ( $ database -> getDatabase ( ) ) ; case 'pgsql' : return ( new PgsqlCommand ( ) ) -> host ( $ database -> getHostname ( ) ) -> username ( $ database -> getUser ( ) ) -> password ( $ database -> getPassword ( ) ) -> database ( $ database -> getDatabase ( ) ) ; } }
Resolve database import command.

@param string|null $service
The database service name.

@return CommandBuilder
The database command based on the provide service.
Resolve database import command .