AOP proxies support classes implementing an interface declaring a __construct() signature
Currently AOP proxy classes add a few parameters to the constructor in order to inject the Object Manager and the Object Factory. The drawback is however that such a constructor won't be compatible to a possible interface which declared a certain constructor signature.
The Adviced and Empty Constructor Builder (and the Proxy Class Template) should be modified in a way that the parameters of a __construct() method are identical to that of the target class.
- One way to do that is to not call parent::__construct() in the proxy's constructor but save the passed arguments temporarily. The constructor returns without any further action.
- The Object Manager and Object Factory can be injected either through a injectFLOW3_AOP_Proxy_ObjectManager() method or by annotating the property $FLOW3_AOP_Proxy_ObjectManager with some @inject annotation.
- The parent constructor is called after all dependencies have been injected and the AOP proxy class has been prepared. That could be before or right at the beginning of initializeObject().
The question is what consequences it would have if the constructor of the target class actually is called after all inject methods.
- [+FEAT]: FLOW3 (AOP): AOP proxies now support classes implementing an interface declaring a __construct() signature. Resolves #3650
- [+FEAT]: FLOW3 (Object): The object manager handles the new AOP proxies.
- [TASK]: FLOW3 (Persistence): Changed some fixtures to comply to the now AOPProxyInterface.
#4 Updated by Karsten Dambekalns about 10 years ago
- Status changed from Resolved to Accepted
- Assignee changed from Andreas Förthner to Karsten Dambekalns
- % Done changed from 100 to 90
Almost, but the original constructor is never called, unless it is advised with anything calling proceed() it seems. Fix is being worked on.