beforeSave() method in content types

View: New views
1 Messages — Rating Filter:   Alert me  

beforeSave() method in content types

by Phil Kemp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys,

I'm interested in running some extra code when a new object for a custom content type is created. I've seen there's a method called beforeSave() but I was wondering how this is used and is there a method that is executed only when the object is created for the first time? I only want to run this extra code when it's created.

Any help or pointers would be appreciated,

Cheers,