Keeping performance and best practices in mind, what would be the best approach to achieve this?

An Adobe Commerce developer is developing a class that is executed in both the frontend and crontab areas. When executed in the frontend MagntoCustomerModelsession::getCu5tonteria() is called but when executed in the crontab this section of code is skipped.

Keeping performance and best practices in mind, what would be the best approach to achieve this?
A . Inject the MagentoCustomerModelSessionProxy class in the constructor of their class and call the getCustomer id function wherever required in the class.
B . Declare MagentoCustomerModelSession in the constructor dependency of their class and declare a proxy in the di.xml. Then call the getCustomerid function wherever required in the class.
C . Declare MagentoCustomerModel.session in the constructor of their class dependency and call the getCustomrid() function wherever required.

Answer: B

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