Event Handlers
There are essentially four things that Speck does with content items; puts them somewhere using cf_spContentPut, gets them from somewhere using cf_spContentGet, promotes them from one level to another using cf_spPromote and deletes them using cf_spDelete.
When each of these events occurs, Speck will fire any relevent event handlers in both content types and property types. To create event handlers in your content types, you simply create a new method definition using the cf_spHandler tag and give the method name one of contentGet, contentPut, promote or delete.
ContentGet event handlers are fired after Speck has retrieved the content. ContentPut, promote and delete event handlers are fired before the content is saved/put, promoted or deleted. Changes to the values of keys in the content structure within a contentPut method will result in the new values being saved by Speck.
The image content type included with Speck includes a contentPut method that is a good example. It gets the dimensions of an uploaded image and then sets the value of related width and height properties. These values are saved in the database and can then be used in methods that display the content.