GetMetaData Returns phantom Parameters
I'm playing around with GetMetaData to do a little introspection of my CFC's when I ran into an anomaly I don't understand.
My CFC has multiple functions embedded within it. One of these functions is defined as follows:
<cffunction name="getMyDenied" access="public" returntype="query">
<cfargument name="userid" type="string" required="yes">
<cfargument name="environment" type="string" required="no" default="0" hint="Pass in 0 for Development and 1 for Production">
...
</CFFUNCTION>
When I exam the CFC using GetMetaData I get this output for the getMyDenied function:
The thing that confuses me is why the HINT parameter is showing up in the userid argument.
The weird thing about this is if I exam the HINT parameter using #Len(TRIM(CFC_Functions.functions[cc].Parameters[1].Hint))# I get the number 6. If I copy the value into a new array or structure and then CFDUMP the results it shows up as an "Empty String".
Then in the same CFC I also have this function:
<cffunction name="getMyPurchaseOrders" access="public" returntype="query">
<cfargument name="userid" type="numeric" required="yes">
<cfargument name="environment" type="string" required="no" default="0" hint="Pass in 0 for Development and 1 for Production">
...
</CFFUNCTION>
When I exam the CFC using GetMetaData I get this output for the getMyPurchaseOrders function:
So my two questions are:
- Why does the getMyPurchaseOrders function return properly where as the getMyDenied function returns a phantom HINT parameter?
- How do I trap the phantom HINT parameter? What I can tell is:
- if I run IsValid('String',CFC_Functions.functions[cc].Parameters[xx].Hint) against the variable the return is TRUE.
- <CFSET z = ToString(CFC_Functions.functions[cc].Parameters[xx].Hint)> #Len(TRIM(z))# returns 6.
- <CFIF CFC_Functions.functions[cc].Parameters[xx].Hint EQ ' '>WTF<CFELSE>Nada</CFIF> always returns Nada even though I entered 6 spaces in the EQ clause.
Any thoughts or suggestions are welcome!!!
