-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add documentation for auto primary key doctrine generators #62
Conversation
Is it possible to override ID generator for all entities at once (instead of doing it on per entity basis)? |
As it's done automatically, if you set the ID for all entities then the ID generator will be overridden for all |
I don't want to set ID, but ID generator, like: $dummyMetadata = $this->manager->getMetadataFactory()->getMetadataFor(Dummy::class);
// Disable the auto generation of the foreign key
$dummyMetadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$dummyMetadata->setIdGenerator(new MyIdGenerator()); But not only for |
oh, yeah not out of the box. But you should be able to easily overwrite the existing persister loader to do that. Maybe it can be refactored a bit to make it easier |
This PersisterLoader? How? It's |
Actually overriding https://github.com/theofidry/AliceDataFixtures/blob/master/src/Bridge/Doctrine/Persister/ObjectManagerPersister.php seems more correct. You can override it by creating your own class and registering a service with the same ID.
|
Thanks @theofidry! Do you think that making |
@theofidry This makes it even harder to override. |
that or making the persister extendable and putting some logic in a method to make it easy to override. I'm fine either way.
Indeed this should be in a factory instead :/ |
Fixed in #91. Thanks! |
Closes #40