[eluser]xwero[/eluser]
I think that would be a problem because the action methods (get,insert,update,delete) have the final methods for building the query or you should add the methods view_get, view_insert, view_update and view_delete to the AR library
Code:
function view_get($table = '', $limit = null, $offset = null)
{
if ($table != '')
{
$this->from($table);
}
if ( ! is_null($limit))
{
$this->limit($limit, $offset);
}
return $this->_compile_select();
}
function view_insert($table = '', $set = NULL)
{
if ( ! is_null($set))
{
$this->set($set);
}
if (count($this->ar_set) == 0)
{
if ($this->db_debug)
{
return $this->display_error('db_must_use_set');
}
return FALSE;
}
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
return $this->display_error('db_must_set_table');
}
return FALSE;
}
$table = $this->ar_from[0];
}
return $this->_insert($this->dbprefix.$table, array_keys($this->ar_set), array_values($this->ar_set));
}
function view_update($table = '', $set = NULL, $where = null)
{
if ( ! is_null($set))
{
$this->set($set);
}
if (count($this->ar_set) == 0)
{
if ($this->db_debug)
{
return $this->display_error('db_must_use_set');
}
return FALSE;
}
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
return $this->display_error('db_must_set_table');
}
return FALSE;
}
$table = $this->ar_from[0];
}
if ($where != null)
{
$this->where($where);
}
return $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where);
}
function view_delete($table = '', $where = '')
{
if ($table == '')
{
if ( ! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
return $this->display_error('db_must_set_table');
}
return FALSE;
}
$table = $this->ar_from[0];
}
if ($where != '')
{
$this->where($where);
}
if (count($this->ar_where) == 0)
{
if ($this->db_debug)
{
return $this->display_error('db_del_must_use_where');
}
return FALSE;
}
return $this->_delete($this->dbprefix.$table, $this->ar_where);
}