开发者

Determining if saving a model is successful in Symfony

How will I determine if a new model was successfully save in symfony? I checked the return value of a model. For example $r开发者_运维知识库et = $model->save(); but $ret returns null.


Usually, an exception (e.g. PropelException) will be thrown if something goes wrong. Text message will look like this: PropelException: Unable to execute UPDATE (ADD) statement...


you can query it after the save() method, and if the result is not empty save() has gone fine

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜