Controller_Data_SQL::dsql PHP Method

dsql() public method

public dsql ( $model )
    public function dsql($model)
    {
        if (!$model->table) {
            throw $this->exception('$table property must be defined');
        }
        $model->dsql = $model->app->db->dsql();
        $model->dsql->debug =& $model->debug;
        $model->dsql->table($model->table, $model->table_alias);
        $model->dsql->default_field = $model->dsql->expr('*,' . $model->dsql->bt($model->table_alias ?: $model->table) . '.' . $model->dsql->bt($model->id_field));
        $model->dsql->id_field = $model->id_field;
        return clone $model->dsql;
    }