-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
[Question] How to refer an object from native Doctrine fixtures? #1237
Comments
Hi! The answer depends on a bit on how you are calling Alice, but given your issue I assume you are calling directly a loader. With AliceDataFixtures, there is a |
Thanks for quick answer. I've tried to bump to How can I emulate similar behavior in our old nelmio/alice? Link to code could be enough. |
So... I'll have to assume we are talking of Alice2 then? Probably overriding https://github.com/nelmio/alice/blob/2.x/src/Nelmio/Alice/Fixtures/Loader.php#L268 or something like that... I'm not super familiar with the v2 codebase, it's a very old one which I barely touched (mostly adding tests when designing v3...) in v3 the NelmioAlice loader should allow the same, but note that it does not persist objects, so I'm not sure how it's done in your codebase... |
Thanks 👍 It's a fork of fork of 2.3.x to be exact. |
Hi, I'm doing a huge migration of old forked Alice/Fixture/Hautelook/Faker packages (total mess).
We use native Doctrine PHP fixtures, where we set a reference:
We use these object further in Alice fixture, where we fetch them from database (not sure why).
I want use reference in Alice to avoid calling database, as we normally do:
But this doesn't work. Any way how to make it happen?
I've noticed there is a
\Doctrine\Common\DataFixtures\ReferenceRepository
that collects all references, but not sure how/where to inject it into Alice, so Alice can fetch referenced objects from there.Thank you 🙏
The text was updated successfully, but these errors were encountered: