Ouzo\Db\ModelQueryBuilder::__construct PHP Method

__construct() public method

public __construct ( Model $model, Db $db = null, $alias = null )
$model Ouzo\Model
$db Ouzo\Db
    public function __construct(Model $model, Db $db = null, $alias = null)
    {
        $this->_db = $db ? $db : Db::getInstance();
        $this->_model = $model;
        $this->_query = new Query();
        $this->_query->table = $model->getTableName();
        $this->_query->aliasTable = $alias;
        $this->_query->selectType = PDO::FETCH_NUM;
        $this->_query->selectColumns = array();
        $this->selectModelColumns($model, $this->getModelAliasOrTable());
    }