I've kept it very simple, so you use it like this:
<?php // At the query: $dependency = new FlushableDependency($id,'Post'); $post = Post::model()->cache(3600,$dependency)->findByPk($id); // In the model: FlushableDependency::flushItem($this->id,'Post');
Maybe i'll add a behavior to the extension which you can attach to your ActiveRecords to automate this. But i'm hesitating because it may not catch all updates (e.g. calls to saveAttributes()).
Let me know, what you think about it.
Updated the examples for 1.1.0.
This post has been edited by Mike: 24 May 2012 - 09:50 AM