Why don't work CDbCriteria with "with" property for CActiveDataProvider?

Hi,

Why don’t work CDbCriteria with “with” property for CActiveDataProvider?

Example code:


$testCriteria = new CDbCriteria();

$testCriteria->with = array('productCategories');

$testCriteria->compare('productCategories.categoryId', 1);


$model = Product::model()->findAll($testCriteria);

var_dump($model); //It work good.


$dataProvider = new CActiveDataProvider('Product', array('criteria'=>$testCriteria));

var_dump($dataProvider->getData()); //It return: Unknown column 'productCategories.categoryId'...

Thanks

Does this help?




$testCriteria = new CDbCriteria();

$testCriteria->with = array('productCategories');

$testCriteria->together = true;

$testCriteria->compare('productCategories.categoryId', 1);



Oh I forget this.

Thanks a lot.