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

Translatable not working from CLI Command #351

Open
arcovoltaico opened this issue Jul 5, 2017 · 0 comments
Open

Translatable not working from CLI Command #351

arcovoltaico opened this issue Jul 5, 2017 · 0 comments

Comments

@arcovoltaico
Copy link

0
down vote
favorite
I'm trying to find documentation for retrieving translated records via translatable (StofDoctrineExtensionsBundle) when executing a console command from Symfony. This command call a service that retrieves data from Doctrine using the

$query->setHint(\Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\Translatable\Query\TreeWalker\TranslationWalker')
->setHint(\Gedmo\Translatable\TranslatableListener::HINT_TRANSLATABLE_LOCALE, $lang);

There service runs a foreach ($users as $user) so $lang= $user->getLang() as I need that doctrine returns localized values depending on the laguage/locale of each users in my DB.

If I call this service from a URL (a Controller) translatable works fine, but if I run the command from the CLI , Translatable is not fired or fails to force the locale ($lang). Any idea to solve that? Thanks!

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

No branches or pull requests

1 participant