Closed mcordoba closed 9 years ago
There is an indexBy on the OneToMany relation from the Translatable object to the Translation. If you map this relation yourself, you should add the indexBy yourself. If you let this extension handle the relation then the indexBy is defined here: https://github.com/Prezent/doctrine-translatable/blob/master/lib/Prezent/Doctrine/Translatable/EventListener/TranslatableListener.php#L172
In having the same issue. The problem exists when the entity is just created (not loaded from database) ans we use the AbstractTranslatable. AbstractTranslatable does not index the array of translation by the locale, so if you try to use translate() before saving the entity a new empty translation is created.
@LouTerrailloune Should be fixed in master. Can you test it? If it works I'll tag a new version.
@sandermarechal I didn't test it but it's seems to be ok.
Tagged as 1.1.2. Thanks!
Hi,
I am using your extension for symfony in order to get translation working but Im having a problem.
I am following the instructions in the documentation and it says you have to include this method in your entity:
I think the translation collection is not being indexed by the locale string because in the line with:
$this->translations->get($locale) is always returning null.
I have been reviewing your code and I cant find where is the collection being indexed by the locale string.
I'll appreciate any help.
Thank you in advance.