defaultScope is cleaner and is meant to be used when you want to add something common to all model queries. You have to write less code, you don't have to create new objects or whatsoever. Just condition and params.

defaultScope is cleaner and is meant to be used when you want to add something common to all model queries. You have to write less code, you don't have to create new objects or whatsoever. Just condition and params.

depending on what you would expect as a final result. In your specific implementation there is no difference. But if you refer to the docs: http://www.yiiframew...ultScope-detail you will see that defaultScope for example is only valid for SELECT statements. Also one of the major ideas behind defaultScope is to achiev DB table inheritance But even in your case I would still use defaultScope as it merges into $criteria automatically. Anyway frameworks are there to think instead of you from time to time

depending on what you would expect as a final result. In your specific implementation there is no difference. But if you refer to the docs: http://www.yiiframew...ultScope-detail you will see that defaultScope for example is only valid for SELECT statements. Also one of the major ideas behind defaultScope is to achiev DB table inheritance But even in your case I would still use defaultScope as it merges into $criteria automatically. Anyway frameworks are there to think instead of you from time to time