BoxLang 🚀 A New JVM Dynamic Language Learn More...
// Reactor ORM
{ class="coldbox.system.orm.reactor.ReactorLoader",
properties = {
ReactorFactoryClassPath = "#appMapping#/model/reactor/reactorFactory",
dsnAlias = "myDSN",
pathToConfigXML = "config/Reactor.xml.cfm",
project = "myProject",
mapping = "/#appMapping#/model/reactor",
mode = "production"
}
}
<cfproperty name="reactor" inject="ocm" scope="instance" />
<cfset Instance = StructNew() />
getPlugin("beanFactory").autowire(Instance.reactor);
<cfcomponent hint="I am the database agnostic custom Record object for the user object. I am generated, but not overwritten if I exist. You are safe to edit me."
extends="reactor.project.myproject.Record.userRecord" autowire="true">
<!--- Place custom code here, it will not be overwritten --->
<!--- Autowire dependencies --->
<cfproperty name="adminEmail" inject="coldbox:setting:adminEmail" scope="instance" />
<cfset Instance = StructNew() />
<!--- Get display authorization array or specific value from array index --->
<cffunction name="getUsername" access="public" hint="I get the 'username' value." output="false" returntype="any" _returntype="string">
<!--- This function now has access to the adminEmail setting from the ColdBox config --->
<cfset Instance.adminEmail />
</cffunction>
</cfcomponent>
$
box install Reactor-factory-with-autowire-support