public static function fromArray(string $id, string $dsn, array $properties): DatabaseConfiguration
    {
        $self = new self($id, $dsn);
        if (isset($properties['username'])) {
            $self->userName = $properties['username'];
            unset($properties['username']);
        }

        if (isset($properties['password'])) {
            $self->setPassword(Secret::create($properties['password']));
            unset($properties['password']);
        }

        if (isset($properties['initialQuery'])) {
            $self->initialQuery = $properties['initialQuery'];
            unset($properties['initialQuery']);
        }

        if (isset($properties['details'])) {
            $self->details = $properties['details'];
            unset($properties['details']);
        }

        $self->properties = $properties;
        return $self;
    }
public static function fromArray(string $id, string $dsn, array $properties): DatabaseConfiguration
    {
        $self = new self($id, $dsn);
        if (isset($properties['username'])) {
            $self->userName = $properties['username'];
            unset($properties['username']);
        }

        if (isset($properties['password'])) {
            $self->setPassword(Secret::create($properties['password']));
            unset($properties['password']);
        }

        if (isset($properties['initialQuery'])) {
            $self->initialQuery = $properties['initialQuery'];
            unset($properties['initialQuery']);
        }

        if (isset($properties['details'])) {
            $self->details = $properties['details'];
            unset($properties['details']);
        }

        $self->properties = $properties;
        return $self;
    }
public static function fromArray ( string $ id , string $ dsn , array $ properties ) : DatabaseConfiguration { $ self = new self ( $ id , $ dsn ) ; if ( isset ( $ properties [ 'username' ] ) ) { $ self -> userName = $ properties [ 'username' ] ; unset ( $ properties [ 'username' ] ) ; } if ( isset ( $ properties [ 'password' ] ) ) { $ self -> setPassword ( Secret :: create ( $ properties [ 'password' ] ) ) ; unset ( $ properties [ 'password' ] ) ; } if ( isset ( $ properties [ 'initialQuery' ] ) ) { $ self -> initialQuery = $ properties [ 'initialQuery' ] ; unset ( $ properties [ 'initialQuery' ] ) ; } if ( isset ( $ properties [ 'details' ] ) ) { $ self -> details = $ properties [ 'details' ] ; unset ( $ properties [ 'details' ] ) ; } $ self -> properties = $ properties ; return $ self ; }
create connection data instance from an array

Please note that this method does not support driver options. Driver
options must be set separately.

@param   string  $id
@param   string  $dsn
@param   array   $properties
@return  \stubbles\db\config\DatabaseConfiguration
create connection data instance from an array