Let's say I have a Widget
table and the Yii Model class that goes with it.
I want to be able to instantiate it ($tempWidget = new Widget
) but somehow make sure it cannot be saved to the database. I want to use the model just for the user to test things, simulate...
Obviously, I could just avoid to call $tempWidget->save()
but I'd like some kind of flag that would prevent save from saving, in case some other part of the code tries to do so.