How Does Yii Default Scopes Work?

Can someone please help me understand the process of where the default scopes are called? I can’t seem to find anything regarding that anywhere - I have checked, CActiveRecord, CDbCriteria, and CActiveDataProvider with no luck.

Where does the defaultScopes get deployed into? Where does it get stored?

  • Gasim

The active record find methods call the method query(), which calls applyScopes(), which in turn calls getDbCriteria() in which the default scope is applied.