Welcome Guest, Not a member yet? Register   Sign In
Using CI with traditional PHP Objects
#8

[eluser]Pascal Kriete[/eluser]
Can you clarify what you're trying to achieve? I don't get the whole 'abstract to another class' thing. Most of the time one request won't do multiple things to a cat, will it?

I would personally just modify the cats directly with model calls:
Code:
// Model
// ...
return $query->result();

And then play with the cats:
Code:
// An awful example...
$cats = $this->cat_model->get_cats();

foreach($cats as $cat)
{
    if ($cat->name == 'Old Crumples')
    {
        $moto = 'I can haz ...';
        $this->cat_model->update_moto($cat->id, $moto);
    }
}

And as a side note, this piece of code:
Code:
foreach( $query->result_array() as $row )
{
    $result[] = $row;
}

It's merely copying an array:
Code:
$result = $query->result_array();


Messages In This Thread
Using CI with traditional PHP Objects - by El Forum - 10-29-2008, 01:19 PM
Using CI with traditional PHP Objects - by El Forum - 10-29-2008, 02:16 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 12:10 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 12:44 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 01:18 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 02:03 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 02:14 PM
Using CI with traditional PHP Objects - by El Forum - 10-30-2008, 02:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB