ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 5 - AD0-E716 discussion

Report
Export

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes. xml file that the developer created in their module:

What is the problem with this xml snippet?

A.
The extension attribute references the wrong interface, it should have referenced the Magento\saies\Api\data\invoiceinterface.
Answers
A.
The extension attribute references the wrong interface, it should have referenced the Magento\saies\Api\data\invoiceinterface.
B.
The extension attribute references the repository instead of the interface it implements (Magento\saies\Api\invoiceRepositorymterface).
Answers
B.
The extension attribute references the repository instead of the interface it implements (Magento\saies\Api\invoiceRepositorymterface).
C.
The type is wrong, string [] should be replaced with array.
Answers
C.
The type is wrong, string [] should be replaced with array.
Suggested answer: B

Explanation:

The extension attribute is referencing the repository instead of the interface it implements. The correct XML snippet should be:

XML

<extension_attributes>

group='General'

translate='true'>

<description>This attribute stores an array of custom values for the invoice.</description>

<source_model>Magento\Sales\Api\Data\InvoiceInterface</source_model>

</extension_attributes>

The source_model attribute specifies the interface that the extension attribute is associated with. In this case, the extension attribute is associated with the Magento\Sales\Api\Data\InvoiceInterface interface.

asked 02/10/2024
Geetanjali Singh
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first