QuestionQ4

Store Operations and Admin

An Adobe Commerce Architect must log the result of a ServiceClass::getData method execution after every plugin has run. The method is public, and several plugins are declared for it. These plugins include after and around types, and each has a specified sortOrder.

Which solution should be used to satisfy this requirement?

Explanation

An around plugin with the lowest sortOrder wraps every higher-priority-numbered plugin execution. Logging after its $proceed() call returns occurs only after the observed method and all subsequent plugins—including their after methods and the post-proceed portions of their around methods—have completed. Adobe Commerce documents that around plugins affect the execution flow of all plugins that follow them and that plugin priority is determined by sortOrder.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!