Last active
June 1, 2016 00:27
-
-
Save cameroncf/687c049cb79003ac0afff9b52054f528 to your computer and use it in GitHub Desktop.
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
// all ORM entities need to extend me | |
conponent | |
{ | |
public any function getService( required string objectName ) { | |
getBeanFactory().getBean( arguments.objectName ); | |
} | |
private any function getBeanFactory() { | |
return application[ request.framework_applicationKey ].factory; // get DI/1 factory | |
} | |
} |
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
// Example ORM bean that inherits the ability to use DI/1 BeanFactory | |
compoment | |
extends = "DIAwareORMBean" | |
{ | |
var someService = getService('Anything-In-DI-Bean-Factory'); | |
} |
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
// Example ORM bean that Programmatically accesses DI/1 BeanFactory | |
compoment | |
{ | |
var someService = new DIAwareORMBean().getService('Anything-In-DI-Bean-Factory'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment