>> Is there an easy way to see the values stored in CFC?
In my CFCs I place all instance variables into an "instance" struct. Then I
can use:
<cffunction name="getMemento" access="public" returntype="Struct"
output="false">
<cfargument name="collection" type="struct" required="false"
default="#structNew()#">
<cfset var Local = StructNew()>
<cfloop collection="#variables.instance#" item="Local.i">
<cfif StructKeyExists(variables.instance, Local.i)>
<cfset arguments.collection[Local.i] =
variables.instance[Local.i]>
</cfif>
</cfloop>
<cfreturn arguments.collection>
</cffunction>
If you place everything in the variables scope, you can use:
<cffunction name="getMemento">
<cfreturn duplicate(variables) />
</cffunction>
Keep in mind that this will also display all methods of the CFC as well.
>> Does it work recursively, so if a cfc member points to another cfc
instance, then that cfc is "dumped" in the same way?
Unfortunately, any composite CFCs will display in their 'object'
representation, unless you build a recursive getMemento method, and each
child object would have to support that interface.
HTH,
Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309463
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4