Hi,
I'm a bit confused about the different behaviour between ::model() and CActiveDataProvider. Using the same criteria object:
Calling
I'm a bit confused about the different behaviour between ::model() and CActiveDataProvider. Using the same criteria object:
$crit = new CDbCriteria(); $crit->with = array( 'categoryHasLanguages' ); $crit->select = array( 'id', new CDbExpression('IFNULL(categoryHasLanguages.translation, t.name) AS name'), 'slug' ); $crit->addColumnCondition( array( 'id_organization' => $organization, 'categoryHasLanguages.id_language' => $lang, ) );
Calling
Category::model()->findAll( $crit );works, but calling
$dataProvider = new CActiveDataProvider( 'Category', array( 'criteria' => $crit, ) );, doesn't. I know how to get it working, adding
$crit->together = true;, but I'm asking if someone can explain this to me
