public function generateConfFromDB(DBUtils $dbUtils, GuesserInterface $guesser): array
    {
        $this->conn = $dbUtils->getConn();

        // First step : get the list of tables
        $tables = $this->getTablesList();
        if (empty($tables)) {
            throw new NeuralyzerConfigurationException('No tables to read in that database');
        }

        // For each table, read the cols and guess the Faker
        $data = [];
        foreach ($tables as $table) {
            $cols = $this->getColsList($table);
            // No cols because all are ignored ?
            if (empty($cols)) {
                continue;
            }

            $data[$table]['cols'] = $this->guessColsAnonType($table, $cols, $guesser);
        }

        if (empty($data)) {
            throw new NeuralyzerConfigurationException('All tables or fields have been ignored');
        }

        $config = [
            'entities' => $data
        ];

        $processor = new Processor();

        return $processor->processConfiguration(new ConfigDefinition, [$config]);
    }
public function generateConfFromDB(DBUtils $dbUtils, GuesserInterface $guesser): array
    {
        $this->conn = $dbUtils->getConn();

        // First step : get the list of tables
        $tables = $this->getTablesList();
        if (empty($tables)) {
            throw new NeuralyzerConfigurationException('No tables to read in that database');
        }

        // For each table, read the cols and guess the Faker
        $data = [];
        foreach ($tables as $table) {
            $cols = $this->getColsList($table);
            // No cols because all are ignored ?
            if (empty($cols)) {
                continue;
            }

            $data[$table]['cols'] = $this->guessColsAnonType($table, $cols, $guesser);
        }

        if (empty($data)) {
            throw new NeuralyzerConfigurationException('All tables or fields have been ignored');
        }

        $config = [
            'entities' => $data
        ];

        $processor = new Processor();

        return $processor->processConfiguration(new ConfigDefinition, [$config]);
    }
public function generateConfFromDB ( DBUtils $ dbUtils , GuesserInterface $ guesser ) : array { $ this -> conn = $ dbUtils -> getConn ( ) ; // First step : get the list of tables $ tables = $ this -> getTablesList ( ) ; if ( empty ( $ tables ) ) { throw new NeuralyzerConfigurationException ( 'No tables to read in that database' ) ; } // For each table, read the cols and guess the Faker $ data = [ ] ; foreach ( $ tables as $ table ) { $ cols = $ this -> getColsList ( $ table ) ; // No cols because all are ignored ? if ( empty ( $ cols ) ) { continue ; } $ data [ $ table ] [ 'cols' ] = $ this -> guessColsAnonType ( $ table , $ cols , $ guesser ) ; } if ( empty ( $ data ) ) { throw new NeuralyzerConfigurationException ( 'All tables or fields have been ignored' ) ; } $ config = [ 'entities' => $ data ] ; $ processor = new Processor ( ) ; return $ processor -> processConfiguration ( new ConfigDefinition , [ $ config ] ) ; }
Generate the configuration by reading tables + cols

@param  DBUtils $dbUtils
@param  GuesserInterface $guesser
@return array
@throws NeuralyzerConfigurationException
Generate the configuration by reading tables + cols