That function doesn't account for inheritance. Not a big deal to
recursively look through the meta data though. I think I posted a
function on CFCDev a while back that did this. I can dig it up if
anyone's interested
cheers,
barneyb
On 7/28/05, Dave Carabetta <[EMAIL PROTECTED]> wrote:
> On 7/28/05, Troy Simpson <[EMAIL PROTECTED]> wrote:
> > Is there a way to determine what type an Object/CFC is? For example:
> >
> > oPatron = createObject("component","patron").init();
> > IsObject(oPatron, "patron") )
> >
> >
> > I am using ColdFusion MX 6.1 for Sun Solaris.
> >
>
> As a native function? Not that I'm aware of. I created this UDF a long
> time ago to solve this exact issue, and it works like a charm. Feel
> free to steal it.
>
> <cffunction name="isInstanceOf" output="No" returntype="boolean"
> hint="I check to see whether a given object is an instance of the
> specified instance type.">
> <cfargument name="obj" type="Any" required="Yes" hint="Any CFC
> instance." />
> <cfargument name="name" type="string" required="Yes" hint="The name
> to check against." />
>
> <cfreturn (not
> compareNoCase(listLast(getMetaData(arguments.obj).name, "."),
> arguments.name)) />
> </cffunction>
>
> Regards,
> Dave.
>
>
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 50 invites.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213213
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54