coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
275 stars 157 forks source link

Fix evil Container Getter #285

Closed solverat closed 6 years ago

solverat commented 6 years ago

@dpfaffenbauer should we keep this and wait until pimcore allows nice DI in pimcore objects? If we keep it: remove all getOrder*Repository and use the order object directly. Otherwise we need to find a hacky way to get the relations in state machine callbacks, like here.

dpfaffenbauer commented 6 years ago
  1. ClassDefinitions are not possible, since the way Pimcore handles it.
  2. getOrder*Repository is possible, I'll look into it.
dpfaffenbauer commented 6 years ago

Pimcore would need to refactor the way they create and store ClassDefinitions. Currently, they store a definition_*.php file with static file-names. To solve that, they would need to either store it as xml/yml or json definition file. Then, instead of using FQCN, they would need to use identifiers, eg. instead of CoreShop\Bundle\CurrencyBundle\CoreExtension\Currency simply coreShopCurrency, that is then fetched from a registry/service-locator.

I guess thats even possible using Doctrine, I already looked a bit into it, but that would be a huge refactor and a conceptual change as well...

dpfaffenbauer commented 6 years ago

fixed as good as possible. unfortunately not possible with pimcore object tags