So how do I create a getter to get an entire member if my current get
function doesn't do it? Say I want to populate an update member form?
<cffunction name="get" access="public" output="false"
returntype="membermanager.model.member">
<cfargument name="aid" type="numeric" required="true">
<cfset init(arguments.aid)>
<cfreturn this>
</cffunction>
Mark Kecko
Technology Director
MediaPost Communications
[EMAIL PROTECTED]
212-204-2002
Sean Corfield wrote:
> On 4/15/05, Mark Kecko <[EMAIL PROTECTED]> wrote:
>
>>So I changed all of my instance variables inside my component to the
>>variables scope. After I did this everything seemed to work fine until
>>I tried to reference my member object. I'm calling the object with
>>invoke in my FB4.1 circuit file like:
>>
>><invoke class="member" methodcall="get(url.memberid)"
>>returnVariable="member" />
>>
>>I used to reference my object on my dsp pages like member.fname and
>>member.lname (when I was using the instance scope) but now that doesn't
>>work anymore. I get fname is undefined in member.
>
>
> Right, you need accessors / getters:
>
> <cffunction name="getFirstName" returntype="string" access="public"
> output="false">
> <cfreturn variables.fname />
> </cffunction>
>
> Then in your dsp pages you say member.getFirstName() instead.
>
> Better encapsulation - makes the object effectively readonly.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Save $10 Download ZoneAlarm Security Suite
http://www.houseoffusion.com/banners/view.cfm?bannerid=66
Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6743
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54