Add named scopes to search any record by status

 This method is useful when you need to create a complex query or construct massive JOIN.
(More info about scopes: http://www.yiiframework.com/doc/guide/1.1/en/database.ar#named-scopes )
I hope it helps.