Why does the dataprovider need you to set the "criteria" / "condition" to limit data?
I limited the data model in my controller, then put the model in the data provider but it still does not limit the data?
Why is this?
Why does the dataprovider need you to set the "criteria" / "condition" to limit data?
I limited the data model in my controller, then put the model in the data provider but it still does not limit the data?
Why is this?
The CActiveDataProvider class is designed to make a new query based on a model class as well as the configuration (criteria, pagination, etc.) that you pass into the __construct() (constructor) function. The fetchData() function is where the criteria and other configuration properties are created and applied to the findAll query. Thus, creating an instance of an AR model in a controller with a limit applied will not affect the results of the data provider because the data provider creates its own separate model instance and applies any criteria passed into it.
Ok thanks for clarifying that.