-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unset does not seem to unset object property on newly created object #1202
Comments
We'll investigate, in the meantime try using whitelists when saving (also gives you more safety): $item->save(null, array('whitelist' => array('_id', 'title')); |
Even if those capabilities were there: when calling All this does not help solve the issue you have now, but explains where it's coming from. Please use whitelists as detailed above, to prevent temporary Technical note: Going forward |
I have an object I am creating for storage in Mongo using Model::create(array()); I store a temporary property on the object for use in an override method of save, and then right before I call parent::save($entity) I unset the property (unset($entity->property) as its not needed anymore. The property is not unset, and when parent::save is called, the property is saved. I can, at this point, say $entity->property = NULL and it updates the value of the property before save, so I'm not sure why unsetting it would still keep a reference. According to: http://li3.me/docs/lithium/data/entity/Document::__unset() I believe this should work. Can anyone cast any light? Am I doing something wrong?
The text was updated successfully, but these errors were encountered: