thanks,
I guess I should've come up with that one myself.
Stupid question :)
On Thu, May 15, 2008 at 1:05 PM, grigri <[EMAIL PROTECTED]> wrote:
>
>> I'm wondering if there is any way that I can know if I'm updating or
>> deleting when I'm inside the beforeSave function
>
> Assuming you meant "updating or creating"...
>
> function beforeSave() {
> if ($this->exists()) {
> // It's an update
> }
> else {
> // It's a create
> }
> }
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---