hi. I have many_many relation. Categories & Articles. Just now I want create data provider for CListVeiw Articles where category id =5;(e.g) But my code gives all the Articles (( Please help!
$criteriaItem = new CDbCriteria();
$criteriaItem->with = array(
'Categories' => array(
'condition' => 'Categories.id = :cat_id',
'params' => array(':cat_id' => $categoryID)
)
);
$articleItems = new CActiveDataProvider('Article', array(
'criteria' => $criteriaItem,
'pagination' => array(
'pageSize' => Y::param('blogItemSize', 5),
'pageVar' => 'page',
),
));