> ...My only issue with that is if there is some kind of error > when the model performs the save, the work will have completed already > - I'd rather not assume that the save will be successful, I'd rather > let the save occur and operate off of its success...this goes back to > using afterSave() which will only trigger when the save was successful. > A quick manual patch in model_php#.php to record whether it was created > or updated during the last save would solve this problem.
Ignore this... this was me thinking about my "save to a different accounting table" problem, and it doesn't really apply the same to your problem. After looking at your code snippet again I realized you're wanting to fill in the created/updated_by fields automatically so that when/if a save occurs, that data will be filled in automatically. That is a very elegant solution. :) But do you really need to validate those fields? Since you're in control of them and creating them yourself, could you still just do your work in beforeSave() instead? Also, like Schmidt.Troy mentioned, Cake will automatically fill in the created_on, modified_on datetime fields for you as long as you have 'created' and 'modified' fields in your table - so for those two fields you don't have to write any extra code. The problem I was attempting to help with was adding support for 'created_by' and 'modified_by' fields and retrieving user information automatically from an Auth solution. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---