ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 12 - AD0-E716 discussion

Report
Export

An Adobe Commerce developer has created a before plugin for the save() function within the

Magento\Framework\App\cache\Proxy class. The purpose of this plugin is to add a prefix on all cache identifiers that fulfill certain criteria.

Why is the plugin not executing as expected?

A.
Another around plugin defined for the same function does not call the callable.
Answers
A.
Another around plugin defined for the same function does not call the callable.
B.
Cache identifiers are immutable and cannot be changed.
Answers
B.
Cache identifiers are immutable and cannot be changed.
C.
The target ClaSS implements Magento\Framework\ObjectManager\NoninterceptableInterface.
Answers
C.
The target ClaSS implements Magento\Framework\ObjectManager\NoninterceptableInterface.
Suggested answer: C

Explanation:

According to the Plugins (Interceptors) guide for Magento 2 developers, plugins are class methods that modify the behavior of public class methods by intercepting them and running code before, after, or around them. However, some classes in Magento 2 implement the NoninterceptableInterface interface, which prevents plugins from being generated for them. The Magento\Framework\App\cache\Proxy class is one of them, as it extends from Magento\Framework\ObjectManager\NoninterceptableInterface. Therefore, the plugin is not executing as expected because the target class implements NoninterceptableInterface. Verified

Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html

asked 02/10/2024
Reed G Porter
28 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first