colinmollenhour / mongodb-php-odm

A simple but powerful set of wrappers for using MongoDb in PHP (also a Kohana 3 module)
BSD 3-Clause "New" or "Revised" License
208 stars 50 forks source link

Before load improved #20

Closed paulchubatyy closed 12 years ago

paulchubatyy commented 13 years ago

When calling before load it is useful to add the data that is gonna be loaded into the model. Maybe some kind of pre-processing and stuff you know.

Please ignore the other commits, I have no idea how they happened here, but they don't seem to carry any changes to the codebase.

Thank you for a great module.

colinmollenhour commented 13 years ago

Is there any processing that can only be done in before_load and not after_load? IMO after_load is more appropriate and allowing only one place to modify data on load might make debugging easier (trying to keep it simple). Besides, unless the $values array is passed by reference, it won't do any good to do pre-processing on it. Adding this parameter has the potential to break existing code so I'd prefer not to unless there is good justification.

Thanks! Colin