How do you resolve the issue, keeping maintainability in mind?

A custom module is performing an optimized custom query for quote items.

The class applies the query customizations on the select object of a quote item collection instance.

You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module.

How do you resolve the issue, keeping maintainability in mind?
A . You change the argument type toMagentoQuoteModelResourceModelQuoteItemCollectionFactory and instantiate the collection using $collectionFactory->create();
B . You remove the constructor argument and use ObjectManager::getInstance()->create(MagentoQuoteModelResourceModelQuoteItemCollection::class) to instantiate the collection instead.
C . You inject MagentoFrameworkDBSelect instead of the collection and perform the desired query independently of the collection.
D . You inject MagentoQuoteApiCartItemRepositoryInterface because low level query customizations are not allowed.

Answer: A

Latest AD0-E709 Dumps Valid Version with 135 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments