I have a problem with the active record relations (i have same relation name for several models).
I have a model that is extended by many classes (let’s say is a translation model). This model contain a relation named “translation”.
I have some models that extends the Translation model. Product, Brand, Category so every model inherit the translation relation.
The Product has 2 more relations : brand and category linked to the corresponding models.
I want to make a single call to obtain all this info translated.
If I call:
Product::model()->with(array(‘translation’, ‘brand’=>array(‘with’=>‘translation’), ‘category’=>array(‘with’=>‘translation’)))
I’ll get an error because of the way the aliases is generated for the sql query (duplicated aliases).
I don’t want to load them lazy or write the sql query manually.
Is there a solution to map somehow the relations?