src/sql/MSqlQueryModel.php
public function setQuery(string $query, ?PDO $db = null)
    {
        if ($db == null) {
            $db = MDbConnection::getDbConnection();
        }

        if ($db instanceof \PDO) {
            $this->query = new MPDOQuery($query, $db);
        } else {
            throw new \Exception("Database connection not supported.");
        }

        $this->query->exec();
    }
public function setQuery(string $query, ?PDO $db = null)
    {
        if ($db == null) {
            $db = MDbConnection::getDbConnection();
        }

        if ($db instanceof \PDO) {
            $this->query = new MPDOQuery($query, $db);
        } else {
            throw new \Exception("Database connection not supported.");
        }

        $this->query->exec();
    }
public function setQuery ( string $ query , ? PDO $ db = null ) { if ( $ db == null ) { $ db = MDbConnection :: getDbConnection ( ) ; } if ( $ db instanceof \ PDO ) { $ this -> query = new MPDOQuery ( $ query , $ db ) ; } else { throw new \ Exception ( "Database connection not supported." ) ; } $ this -> query -> exec ( ) ; }
Returns the QSqlQuery associated with this model.

@param string $query
@param \PDO|null $db
@throws \Exception
Returns the QSqlQuery associated with this model .