CommandSchedulerBundle icon indicating copy to clipboard operation
CommandSchedulerBundle copied to clipboard

Change ScheduledCommand entity to mapped super class

Open diimpp opened this issue 9 years ago • 6 comments

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.

diimpp avatar May 14 '15 14:05 diimpp

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,

j-guyon avatar May 15 '15 13:05 j-guyon

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.

j-guyon avatar May 15 '15 19:05 j-guyon

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.

diimpp avatar May 18 '15 05:05 diimpp

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?

JonathanBaudoin avatar Nov 14 '17 15:11 JonathanBaudoin

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 :)

nahoy31 avatar Aug 22 '18 09:08 nahoy31

Please do submit a PR

chrisjohnson00 avatar Aug 24 '18 06:08 chrisjohnson00