In my symfony 1.4 project I have query with two joins to the same table (different foreign keys):
return ArticleQuery::create(null,$criteria)
->joinWithArticleCategoryRelatedByNewsCategoryId()
->joinWithArticleCategoryRelatedByHelpCategoryId();
I’m getting error:
SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: ‘article_category’
How can I add alias to this join?
Note: I use Propel 1.6
It should be enough to pass an argument to the join method.
Look in your generated BaseArticleQuery.php to see what methods have been generated for you. One of my join methods look like this:
One of the strengths of Propel, is that nearly everything has a concrete method. So if you have an IDE with support for code completion, you can receive hints of what arguments the methods support.