This is the code from my screencast on creating a RESTful API using the Yii Framework