What is the solutio...
 
Notifications
Clear all

What is the solution for this problem?

1 Posts
1 Users
0 Likes
80 Views
(@pochethurman)
Posts: 704
Noble Member
Topic starter
 

Suppose you are working with order collection where you need to get the Customer collection object in foreach loop to check wheather current order's customer accout is locked or not. For this you injected Magento\Customer\Model\Customer $customer in the constructor to use $customer collection object. But in loop when this object is used, you notice that it's returning the same customer even if you pass different customer id to filter the customer collection inside loop.

What is the solution for this problem?

  • A . Use proxy class for customer and use create() method to get a fresh customer object
    B. Use factory class for customer and use create() method to get a fresh customer object
    C. We can not filter a collection in foreach loop, need to use load() on customer model
    D. None of these

Show Answer Hide Answer

Suggested Answer: B
 
Posted : 12/01/2023 5:46 pm
Topic Tags

Latest Adobe AD0-E704 Dumps Valid Version

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