Skip to content

Commit 66052dd

Browse files
853: Extended possible observer references fqns
1 parent 85b61b6 commit 66052dd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/com/magento/idea/magento2plugin/actions/generation/CreateAnObserverAction.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ private boolean checkIsEventDispatchMethod(final MethodReference element) {
136136
return false;
137137
}
138138
final String fqn = ((PhpClass) phpClass).getPresentableFQN();
139-
return Observer.INTERFACE.equals(fqn);
139+
140+
return Observer.INTERFACE.equals(fqn)
141+
|| Observer.IMPLEMENTATION.equals(fqn)
142+
|| Observer.ENTITY_IMPL.equals(fqn);
140143
}
141144

142145
private boolean checkIsElementStringLiteral(final @NotNull PsiElement element) {

src/com/magento/idea/magento2plugin/magento/files/Observer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class Observer implements ModuleFileInterface {
1212

1313
private final String fileName;
1414
public static final String INTERFACE = "Magento\\Framework\\Event\\ManagerInterface";
15+
public static final String IMPLEMENTATION = "Magento\\Framework\\Event\\Manager";
16+
public static final String ENTITY_IMPL = "Magento\\Framework\\EntityManager\\EventManager";
1517
public static final String DISPATCH_METHOD = "dispatch";
1618
public static final String NAME_ATTRIBUTE = "name";
1719
public static final String OBSERVER_EXECUTE_TEMPLATE_NAME = "Magento Observer Execute Method";

0 commit comments

Comments
 (0)