CActiveDataProvider provides data in terms of ActiveRecord objects which are
of class modelClass. It uses the AR CActiveRecord::findAll method
to retrieve the data from database. The criteria property can be used to
specify various query options.

If you want to get a list of blog posts (Post model) including the author (Author model) and you use with('author') to refer to the relationship and get the data with eager loading (recommended), and then use the data provider in a CListView, for example, you'll have to do this in your partial view which renders the items:

First parameter can be a finder for model objects, but not an array of model objects

CActiveDataProvider normally takes a class name ('Post') plus some DB Criteria (either as an array, or an explicit CDbCriteria object), but it can also take a first param of a finder object, which implies both the model class and the criteria.

This finder object can be enhanced with named scopes and parameterized scopes (in any combination), as they merely refine the criteria without actually fetching anything from the database.

(These examples assume that 'published' and 'byAuthor' are scopes defined by the user in the 'Post' model file)

The last one is a common mistake, where the findAll() call actually queries the DB and turns the list of criteria into an actual array of model objects. CActiveDataProvider doesn't know what to do in this case, so it produces a failure:

Fatal error: Call to a member function getDbCriteria() on a non-object in (path)/framework/web/CActiveDataProvider.php on line 114

The solution is to remove any findXXX() methods.

Alternately, if you want a data provider populated with an array, use the CArrayDataProvider() which works that way.