This feels like one of those "you're doing it wrong and it's super obvious" types of problems. I'm attempting to update a record that I'm accessing using the ORM. I'm trying to use the method described under "Update" here: http://fuelphp.com/docs/packages/orm/crud.html
if ($ticket = Ticket::find($id))
{
$ticket->status_id = $status_id;
if ($ticket->save())
{
\Session::set_flash('success', 'The status was updated.');
}
}
This code is throwing an error:
ErrorException [ Error ]: Call to undefined method Orm\Query::save()
You've hit a "feature" that was deprecated in 1.5, and removed in 1.6, because of this problem, and potentionally serious issues.
1.5 allows you do to find(null), which will return a query object instead of a result. In 1.6, you have to use query() for that, find(null) is no longer allowed.
Sorry, I should have mentioned that $id is not null. The find() method is returning a \Model\Ticket object. I then update the status_id, but the save() method throws the error.