-
Notifications
You must be signed in to change notification settings - Fork 140
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
use Alice to load fixtures #194
Comments
How would you handle multi lang content, I guess we need some extension to call bindTranslation? |
i havent looked at the details yet but yeah i guess we might need something along those lines /cc @Seldaek |
one language would be handled by setting the locale field. but after that indeed we would need "something" that knows what is going on. @Seldaek phpcr-odm translated fields can be updated on the same document and with another call to bindTranslation stored in that language. |
Currently I use something like this in our manual fixtures:
which with Alice could be something like this
|
Alice doens't support localization of an entire item at the moment. It can create two documents in two languages though and then you bind them as the two translations.. I don't know exactly how things work in the CMF nowadays but if you can articulate a bit more maybe we find a good solution. Otherwise the latest alice release has processors which allow you to modify the objects on the way to the doctrine object manager, that might also help. |
I did a quick research and unfortunately the different Doctrine behaviours (ORM) feature different APIs and differ again from PHPCR-ODM. I will look into the processors stuff, maybe that can help. |
Unfortunately the processors have no knowledge of the original fixture data, so this doesn't seem to help. Maybe we can introduce an other syntax like
or
|
Can you show me in php code how it looks to populate one of those objects with multiple langs? |
What we need for phpcr odm in the end is something like this:
It would be good to set all the fields and call bindTranslation only once per field, although it should work to repeat it for each field. |
bindTranslation only once per document and locale - might be we would |
For doing this we still have the translations issue and maybe image loading although I'm not sure we have images in the fixtures ... |
we do not have images in the fixtures yet .. but we might want to in the future. |
i remove the 1.0 milestone from this task. its not critical. |
https://github.com/nelmio/alice
related to symfony-cmf/simple-cms-bundle#55
The text was updated successfully, but these errors were encountered: