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

Adding last_action() Method and fixing bug in upsert after_save(). #14

Closed sebicas closed 12 years ago

sebicas commented 13 years ago
  1. last_action property is setted after before_save() and just before after_save()
  2. Even when is not the best option I am keeping the argument to ensure API backward compatibility.

Thanks!

Sebicas

sebicas commented 13 years ago

You are right... sorry... what do you prefer for the name of the property... last_action or after_save?? I think last_action as more sense... right?

sebicas commented 13 years ago

Something that I am not completely sure is the following...

On upsert... shouldn't last_action be either 'insert' or 'update' instead of 'upsert', since technically you already know is an upsert when you to call the method... what do you think?

colinmollenhour commented 12 years ago

The bug in upsert (missing parameter to after_save) is now fixed. I don't understand the need for the last_action method, so if you still want it please explain why it is needed. Also that could be added unobtrusively in a subclass.