Nicholas Morgan Sun Nov 20 05:28:50 -0500 2011
Hey, I know you posted this a month ago so I would imagine you already found a solution but I thought I'd chime in.
You can pass FALSE as a parameter into the save() method and it will automatically skip validations. It says it on this page, in the 2nd block of code:
http://www.phpactiverecord.org/projects/main/wiki/Validations
It should also be listed in the CRUD page, but it's not, which could explain how you might have missed it.
So, you would do something like $my_model->save(FALSE) whenever you want to skip validations. In your case, you would skip validations when you are updating an existing model.
Hope this helps! o:-)
(1-1/1)
Subject: Perform validation only on create
Hi guys, I'm new here:
I've been trying to us the "'on'=>'create'" option for validation as the wiki suggests,
Here is my code,
It seems the option is completely ignored...am I missing something?
I want to set it up like this so that when a user updates their profile, they can leave their password blank to keep their current one.
Thanks for any help you can offer!