public function getDB($db = null)
    {
        if (null !== $db && !($db instanceof DB))
            throw new InvalidTypeException("Invalid database");
        return $db ?: $this->_source_db ?: DI::getInjector()->getInstance(DB::class);
    }
public function getDB($db = null)
    {
        if (null !== $db && !($db instanceof DB))
            throw new InvalidTypeException("Invalid database");
        return $db ?: $this->_source_db ?: DI::getInjector()->getInstance(DB::class);
    }
public function getDB ( $ db = null ) { if ( null !== $ db && ! ( $ db instanceof DB ) ) throw new InvalidTypeException ( "Invalid database" ) ; return $ db ? : $ this -> _source_db ? : DI :: getInjector ( ) -> getInstance ( DB :: class ) ; }
Get a suitable database. Either the provided database argument,
or when null, the source database. If source database is also null,
the default database is returned.
@return Wedeto\DB\DB A suitable database
Get a suitable database . Either the provided database argument or when null the source database . If source database is also null the default database is returned .