I have a bunch of code to paste, so I am going to try to set this up
pseudo code style. here is the layout of what I have that is throwing
the error:
Model A
Model B
Model A
Inject Ocm
Inject Model B
Call Method in B
Model B
Inject Ocm
when model a tries to inject model b and model b has an ocm injection,
I am getting an undefined error on the ocm injection variable
this is the function that errors in model b when it's called via the
model injection from model A
<cffunction name="qUserLevels" access="public" returntype="query"
output="false">
<cfargument name="LevelID" type="numeric" required="false"
default="0">
<cfargument name="HasMenu" type="numeric" required="false"
default="1">
<cfscript>
var qUserLevels=Instance.DataUserLevels;
var qUserLevelsOut=[];
</cfscript>
<CFQUERY NAME="qUserLevelsOut" dbtype="query">
Select LevelID,TextDesc
From qUserLevels
Where 0=0
<cfif IsNumeric(Arguments.LevelID) And Arguments.LevelID GT 0>
And LevelID = <cfqueryparam value="#Arguments.LevelID#" CFSQLType
= 'CF_SQL_NUMERIC'>
</cfif>
<cfif IsNumeric(Arguments.HasMenu) And Arguments.HasMenu GT 0>
And HasMenu >= <cfqueryparam value="#Arguments.HasMenu#" CFSQLType
= 'CF_SQL_NUMERIC'>
</cfif>
</CFQUERY>
<cfscript>
return qUserLevelsOut;
</cfscript>
</cffunction>
model a:
<cfproperty name="Permissions"inject="Model" scope="Instance"/>
the function call:
var qPermissions=Instance.Permissions.qUserLevels(HasMenu=1);
any tips or pointers? can this be done or should I use the
controllers to pass in the model dependencies?