I am trying to build a dataprovider for a grid view. I have tried to use CActiveDataProvider, but I cant find a way to use a ‘with’ in the condition. In another forum i found the following solution.
$quotes = someModel::Model()->with(‘projectR’)->findall(array(‘condition’=>‘quoteId = ‘.$findQ.’ OR name LIKE %’.$findQ.’% AND projectR->owner=’.$user.’’,‘pagination’=>false));
basically with this, i am passing a project list. but i only want to pass projects that belong to the owner of the project. Is there a better way using CActiveDataProvider? or is the above solution close to what i should be doing? Thanks in advance for any help.