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

Referencing fixtures respectively #993

Open
brukrneti opened this issue Apr 26, 2019 · 0 comments
Open

Referencing fixtures respectively #993

brukrneti opened this issue Apr 26, 2019 · 0 comments
Labels

Comments

@brukrneti
Copy link

brukrneti commented Apr 26, 2019

Okey, say we have this scenario: we have 2 entities, Building & BuildingTranslation. Every Building has translations in 3 languages. So 5 Buildings = 15 BuildingTranslation entries in database.
So what I basically want to do is to assign buildings to BuildingTranslation respectively.
I've tried multiple ways of doing it but couldn't make it work so I found a workaround:

App\Entity\Building:
    building_{1..5}:
        street_name: <streetName()>
        street_number: <buildingNumber()>

App\Entity\BuildingTranslation:
  building_translation_{1..5}:
    title: <company()>
    translatable_id: '@building_entity_<current()>'
    locale: 'en'

  building_translation_{6..10}:
    title: <company()>
    translatable_id: '@building_entity_<($current-5)>'
    locale: 'de'

  building_translation_{11..15}:
    title: <company()>
    translatable_id: '@building_entity_<($current-10)>'
    locale: 'fr'

You can see that I calculated referencing entity manually with building_entity<($current-X)>

Is there any other way to make this work? It would be really great to have a feature to loop through the referencing fixtures from the first to the last. Hopefully this will help someone out, at least.

@theofidry theofidry added the Bug label May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants