[eluser]keevitaja[/eluser]
hi,
what is the best way to achieve following:
i need to run several where() and like() in active records before fetching them in more than one place. these where and like are allways same. what changes are the get() and result() type.
something like that:
Code:
class Myclass
{
function filters()
{
if (something)
{
$this->db->where('something')
}
if (something)
{
$this->db->like('something')
}
if (something)
{
$this->db->like('something')
}
if (something)
{
$this->db->where('something')
}
return $this->db
}
}
$myclass->filters()->get('mytable')->result()
$myclass->filters()->where('somethign')->get('mytable')->result_array()