Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
$obj->save();
  • What's the best way of checking if a record saved/updated or not? I know once you call $obj->save() it returns object with the primary id, but what does it return if the save fails? Many thanks.
  • Whenever saving fails it will always throw an exception. The method will always return true, unless the objects was frozen and saving isn't allowed which is the only reason save() would ever return false. This is because "freezing" is used to prevent looping when saving objects that are related in more than 1 way (throw-catching expections there would add unnecessary overhead). In all other cases the method will return true or throw an exception telling you what's wrong.
  • How do you catch exception? you don't want to show exception error on a live site.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion