(without Symfony), and I stumbled into data-fixtures.
However, it isn't working quite as I imagined, and the only documentation is the usage instructions in the README, so I have a few questions.
1. Does the library persist fixtures to db or just keep them in memory?
2. How do I set up a relation to a fixture already added in a previous FixtureLoader?
afaik, doctrine fixtures persist in db Not sure about the second question You can try asking in doctrine slack channel though
Thanks for the response. About the second question. I have two loaders that run one after the other, say posts and comments for example. In the second one (comment) I try to use the objectManager to find a post from the db but db is empty.
I see, I think this is what you're looking for https://github.com/doctrine/data-fixtures#sharing-objects-between-fixtures
Обсуждают сегодня