protected function newDatabaseConfiguration($dsn, $username = 'root', $password = null, $default = true, $id = null)
    {

        // initialize a new database configuration
        $database = new Database();
        $database->setDsn($dsn);
        $database->setDefault($default);
        $database->setUsername($username);

        // query whether or not an ID has been passed
        if ($id === null) {
            $id = Uuid::uuid4()->__toString();
        }

        // set the ID
        $database->setId($id);

        // query whether or not a password has been passed
        if ($password) {
            $database->setPassword($password);
        }

        // return the database configuration
        return $database;
    }
protected function newDatabaseConfiguration($dsn, $username = 'root', $password = null, $default = true, $id = null)
    {

        // initialize a new database configuration
        $database = new Database();
        $database->setDsn($dsn);
        $database->setDefault($default);
        $database->setUsername($username);

        // query whether or not an ID has been passed
        if ($id === null) {
            $id = Uuid::uuid4()->__toString();
        }

        // set the ID
        $database->setId($id);

        // query whether or not a password has been passed
        if ($password) {
            $database->setPassword($password);
        }

        // return the database configuration
        return $database;
    }
protected function newDatabaseConfiguration ( $ dsn , $ username = 'root' , $ password = null , $ default = true , $ id = null ) { // initialize a new database configuration $ database = new Database ( ) ; $ database -> setDsn ( $ dsn ) ; $ database -> setDefault ( $ default ) ; $ database -> setUsername ( $ username ) ; // query whether or not an ID has been passed if ( $ id === null ) { $ id = Uuid :: uuid4 ( ) -> __toString ( ) ; } // set the ID $ database -> setId ( $ id ) ; // query whether or not a password has been passed if ( $ password ) { $ database -> setPassword ( $ password ) ; } // return the database configuration return $ database ; }
Create's and return's a new database configuration instance, initialized with
the passed values.

@param string      $dsn      The DSN to use
@param string      $username The username to  use
@param string|null $password The passed to use
@param boolean     $default  TRUE if this should be the default connection
@param string      $id       The ID to use

@return \TechDivision\Import\Configuration\Jms\Configuration\Database The database configuration instance
Create s and return s a new database configuration instance initialized with the passed values .