Let's say I have the following component called Base:
<cfcomponent output="false">
<cffunction name="init" access="public" returntype="Any" output="false">
<cfset variables.metadata = getmetadata(this)>
<cfreturn this>
</cffunction>
<cffunction name="getmeta" access="public" returntype="Any" output="false">
<cfreturn variables.metadata>
</cffunction>
</cfcomponent>
and I want to extend base in another component called Admin:
<cfcomponent output="false" extends="Base">
</cfcomponent>
Now within my application if I do the following when creating the object:
<cfset obj = createobject("component", "Admin").init()>
<cfdump var="#obj.getmeta()#">
The metadata I get back tells me that the name of the component is Admin and it's extending my Base component. That's all good, but I don't want to have to call the init() method explicitly when creating the object.
I would be nice if I could do something like this in my Base component:
<cfcomponent output="false">
<cfset init()>
<cffunction name="init" access="public" returntype="Any" output="false">
<cfset variables.metadata = getmetadata(this)>
<cfreturn this>
</cffunction>
<cffunction name="getmeta" access="public" returntype="Any" output="false">
<cfreturn variables.metadata>
</cffunction>
</cfcomponent>
However then the metadata returned by the getmeta() method telling me that the component name is Base even though it's still being extended. Any thoughts on how to accomplish this?