In the recipe Using callbacks in behaviors we learnt how to implement different model callbacks to perform some tasks automatically. In this recipe we will continue that process and we will learn how to automatically save data that may not be provided in a
We will use the Twitter example we have been using in this chapter, so that when a profile is saved, its Twitter URL and its last tweet are saved when creating a new record, or when updating an existing one.
We need a working
TwitterAccountBehavior together with its controllers, models, and views. Follow the recipe Using callbacks in behaviors (there's no need to enable caching in the behavior, so you can omit the There's ...