Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a more specific method to handle translations joins #145

Open
emiliemarchand opened this issue Feb 5, 2014 · 0 comments
Open

Create a more specific method to handle translations joins #145

emiliemarchand opened this issue Feb 5, 2014 · 0 comments

Comments

@emiliemarchand
Copy link
Contributor

In the TranslatableEntityRepository, the getCurrentAppName() method is used to check whether or not the translations table should be inner joined or left joined. However, since this method is a bit generic it could be used in the future for other things, but is not currently available in repositories of non-translatable entities.

I suggest we move it into the BaseEntityRepository, which is common to both. And we could use a more specific method available only in the TranslatableEntityRepository to handle the joins. Something like set/getJoinType(). That way, left joins would not be exclusive to the backend app. (Although I don't see another use case at the moment)

For now, I created a quick workaround to fix a bug in the locale switcher by checking if the repository has the translatable trait, but it won't be required anymore if we proceed to those changes. (See this pull request: #144)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant