[eluser]Michael McCabe[/eluser]
Thanks for the timely and invaluable advice so far!
[quote author="lee74" date="1241903872"]Would putting the models attributes in an array help, looping the attributes array rather than the object or fields?
Code:
$attrib['jobref'] = 'ref4354';
$attrib['clientid'] = 'microsoft';
$attrib['title'] = 'uninstall';
Code:
class Jobs_model extends Model {
public $attrib;
function Jobs_model()
{
parent::Model();
}
function get() {
foreach($this->attrib as $key => $val)
if ($val) $this->db->where($key, $val);
}
}
[/quote]
That's pretty much how I had written the model originally but like Dam1an I found it a bit ugly. Worked perfectly well though.
[quote author="Dam1an" date="1241904652"]
(you could do the array method, but use the syntax of the first method if you use the magic set method)[/quote]
I've never heard of the magic set method what is that?.