I need to override this interface
Magento\Catalog\Api\Data\CategoryTreeInterface
I need to add setIncludeInMenu & getIncludeInMenu but there are no extension attributes, how can I achieve this?
I need to override this interface
Magento\Catalog\Api\Data\CategoryTreeInterface
I need to add setIncludeInMenu & getIncludeInMenu but there are no extension attributes, how can I achieve this?
Seems the only core class that implements \Magento\Catalog\Api\Data\CategoryTreeInterface is \Magento\Catalog\Model\Category? This model has extension attributes as it also implements \Magento\Catalog\Api\Data\CategoryInterface. Can you maybe add extension attributes here?
If you've defined a custom class to override the implementation of CategoryTreeInterface (this can be done via di.xml class preference), you might just have to define getter/setter methods on the implementation class. Interfaces by definition cannot be amended with new methods.
CategoryTreeInterface is \Magento\Catalog\Model\Category - which has accessible extension attributes, I'd advise you follow the core devdocs: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/extension_attributes/adding-attributes.html
– Liam Toohey
Feb 16 '22 at 11:17