Hello everybody!
I have three tables (type, category, subcategory) which relate to each other this way:
in Category.php
public function relations()
{
return array(
'type'=>array(self::BELONGS_TO, 'Type', 'type_id'),
'subcategories'=>array(self::HAS_MANY, 'Subcategory', 'category_id'),
);
}
I have working query
$types=Type::model()->with('categories')->findAll();
Is it possible to add subcategories
to this query?
Thanks!