Hi.
What i wanna do is something like
select * from Category inner join Item on Category.id = Item.id_category inner join Images on Item.id = Images.id_item.
I have a scope on the item to get only items with images an a scope in the category to get only the categories with items.
But how can i get only categories with itens that have images.
Is there a way to modify this
public function scopes() {
return array(
'withItem'=>array(
'with'=>'item',
'condition'=>'item.id is not null',
),
);
}
My Category relation
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'item'=>array(self::HAS_MANY, 'Item', 'id_category')
);
}
How can i do that?
I tried to put and item.image.id is not null but no lick