I need to extend the core interface Magento\NegotiableQuote\Api\Data\NegotiableQuoteInterface
and need to add a new constant but when I override the interface via preference its not working. When I read more about this I came to know that we can use extension attributes but not have clear information on this.
Please suggest me how can I add a new constant by overriding the interface.
Thanks in advance.
Add a comment
|
1 Answer
The feature Extension Attributes is more designed for extend attributes for API.
You can define constant in any model or helper inside your custom extension.
You can see example in official documentation Add extension attributes to entities
For add simple attribute to scalar entity:
- Add custom attribute into original table in
etc/db_schema.xml
- Register your attribute in
etc/extension_attributes.xml
- Create plugin for Repository to translate row field into extension attribute on get and back for save
If you have more specific requirements, please update your question or add comment.