try { $model->save(); } catch (Orm\ValidationFailed $e) { // do something with failed validation error message in $e } catch (Orm\InvalidContentType $e) { // do something with the wrong type error message in $e // (though this really shouldn't happen, you should prevent any type errors before going to production) }
Jelmer Schreuder wrote on Sunday 1st of May 2011:Throw an exception and catch it specificly if you want to handle it.
Jelmer Schreuder wrote on Sunday 1st of May 2011:nothing should "quietly fail".
Well, i prefer to have a method that makes massive-something, like massive delete, and it should output nothing. Really. Things just get deleted and I see that immediately. If they don't - probably they are locked by some special parameters. If something unexpected happens - php or framework will most probably inform me.
Model_Example::query()->where('status', '=', 'inactive')->delete();
It looks like you're new here. If you want to get involved, click one of these buttons!