I find no way to define automatic orderBy in m2m relations with column not from reference table, but actual related table.
E.g. BlogPost <= m2m through BlogPostCategory => BlogCategory
I need BlogPost->Categories ordered by BlogCategory.name
The resulting query contains doubled 'name' column in ORDER BY clause, both from reference table and related table, e.g. ORDER BY t2.name, t3.name
I tried putting the following code in BlogCategory::setTableDefinition() instead of attribute in relation definition in BlogPost record:
but the result was the same.
Maybe I'm doing something wrong? Is there a possibility to define an alias, where to get column name from - in orderBy attribute?
Thanks in advance.