Welcome Guest, Not a member yet? Register   Sign In
Model Extension
#3

[eluser]mihailt[/eluser]
that's quite ok, can't say though i didn't see something simular before.
consider returning not $result->result(); but $result.
then with method chaining you can do something like this:

$this->UserModel->find(array('username' => 'blymoth'), true)->result();

not a big addition but brings you access to additional methods like num_rows() and others.

and the other thing i woudn't use array in save method consider changing it to object
and if you are creating new entry you can use stdClass to instaniate empty object


Messages In This Thread
Model Extension - by El Forum - 11-24-2008, 11:30 AM
Model Extension - by El Forum - 11-24-2008, 01:03 PM
Model Extension - by El Forum - 11-24-2008, 02:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB