Last active
September 28, 2023 16:20
-
-
Save evagoras/ac46cf3a0d305ebaa7e69f9e7cf5e405 to your computer and use it in GitHub Desktop.
Intercepting the QB module query executor in a ColdBox application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| component { | |
| // Configure ColdBox Application | |
| function configure(){ | |
| //Register interceptors as an array, we need order | |
| interceptors = [ | |
| // Enable when meeded to intercept QB calls | |
| { | |
| class = "interceptors.qbInterceptor", | |
| name = "qbInterceptor", | |
| properties = {} | |
| } | |
| ]; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| component extends="coldbox.system.Interceptor" alias="qbInterceptor" { | |
| property name="interceptorService" inject="coldbox:interceptorService"; | |
| function configure() { | |
| controller.getInterceptorService().registerInterceptor( interceptorObject = this ); | |
| } | |
| function preQBExecute( event, interceptData = {} ) { | |
| dump(arguments.interceptData); | |
| abort; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://evagoras.com/2019/08/12/intercepting-the-qb-module-query-executor-in-a-coldbox-application/