Overriding Abstract Classes in Pimcore #16979
-
Hello, I'm currently in the process of extending and customizing Pimcore's Cart management system. As part of this customization, I've developed a new abstract class named Upon reviewing the documentation, I came across a note stating that "you cannot override abstract model classes directly". Specifically, it mentions: "But you cannot override Pimcore\Model\Asset (or the other abstract model classes) ifself (as it is the parent class of for example Pimcore\Model\Asset\Image and that would mean to change the class hierarchy)." Documentation link
Any insights or best practices would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@ChakibBrikciSid You cannot change the parent abstract class of the concrete cart implementations as this is directly done with PHP's inheritance feature (therefore no DI possible). If you need to add additional methods to both cart implementations use a trait (and eventually add a additional interface). |
Beta Was this translation helpful? Give feedback.
@ChakibBrikciSid You cannot change the parent abstract class of the concrete cart implementations as this is directly done with PHP's inheritance feature (therefore no DI possible). If you need to add additional methods to both cart implementations use a trait (and eventually add a additional interface).