CommandSchedulerBundle
CommandSchedulerBundle copied to clipboard
Change ScheduledCommand entity to mapped super class
Hi, really nice bundle, thank you for your work. :)
In my project I want to extend repository class, which is not possible due doctrine mappings is not overridable via bundle override. One way to solve it would be to change entity type to mapped super class, like fos user bundle is working.
On separate note, take a look at http://docs.sylius.org/en/latest/bundles/SyliusResourceBundle/ which is very much suited for your cause and could drastically improve extendability (everything become a service and one could override repo by just replacing FQCN), add some features like different managers almost for free.
Example of how repo would be overridden in case of sylius resource bundle http://docs.sylius.org/en/latest/bundles/general/overriding_repositories.html
Let me know if I could assist you with this.
Regards.
Hi,
Thanks for your support and your suggestion !
I am agree that mapped super class offer more extendability, but unlike fosuserbundle, i am not sure that many people need to add custom fields on scheduled command table. (and it will increase the installation process), but i will think about it.
Anyway, i will probably add possibility to override repository. A FQCN in configuration and a ContainerCompiler to create the repository service should be a lightweight developpement.
Best regards,
I realize after writing my last comment, that even in a compiler, we cannot override a repo because its definition is in the doctrine mapping too... :tired_face:
Well, i will think about a super class, maybe in the next major release, because it will be a BC break.
Yeah, that was the issue. :)
Thats is how guys at sylius deal with it. Event listener, that changes class meta data according to config. https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/ResourceBundle/EventListener/LoadORMMetadataSubscriber.php
So if there is no one extending it -- it becomes regular entity, or one could specify repo class in bundle config.
Hello,
This issue is old but very usefull. I can't use this bundle because of the non mapped super class entity. @J-Mose Any news about it ? Would you be interested by a PR?
Hi,
We are very interested in this issue, which does not require much modification, can we do a PR? It could unlock several people who wants to use this very good bundle :)
Please do submit a PR