|
I am curious about the code below ... is there a
BETTER way to call this with CFOBJECt and if so, why?
Once I build the struct "customer" I am going to
stick it into a session named customer.
I am using CFINVOKE This way:
<!--- CFM Template --->
<cfinvoke
component="customerController" method="getCustomer" returnvariable="customer"> <cfinvokeargument name="customerID" value="#checkCustomer.customerID#"> </cfinvoke> <!--- customerController.cfc
--->
<cfcomponent displayname="customer"
hint="Controls all access to customer information add, edit,
delete.">
<cffunction name="getCustomer" output="false" returntype="struct" displayname="Selects Customer" hint="Gets customer information and populates cthe customer structure."> <cfquery datasource="qdc2" name="checkCustomer"> SELECT customerID, firstName, lastName, email, company, address1, address2, city, state, country, zip, dayPhone, evePhone, mailList FROM customer WHERE customerID = <cfqueryparam value="#arguments.customerID#" cfsqltype="CF_SQL_INTEGER"> </cfquery> <cfif checkCustomer.recordcount> <cfset customer = StructNew()> <cfset customer.customerID = checkCustomer.customerID> <cfset customer.firstName = checkCustomer.firstName> <cfset customer.lastName = checkCustomer.lastName> <cfset customer.company = checkCustomer.company> <cfset customer.email = checkCustomer.email> <cfset customer.address1 = checkCustomer.address1> <cfset customer.address2 = checkCustomer.address2> <cfset customer.city = checkCustomer.city> <cfset customer.state = checkCustomer.state> <cfset customer.zip = checkCustomer.zip> <cfset customer.country = checkCustomer.country> <cfset customer.dayPhone = checkCustomer.dayPhone> <cfset customer.evePhone = checkCustomer.evePhone> <cfset customer.mailList = checkCustomer.mailList> <!--- Insert Shipping Information ---> <cfset customer.shipFirstName = ""> <cfset customer.shipLastName = ""> <cfset customer.shipCompany = ""> <cfset customer.shipAddress1 = ""> <cfset customer.shipAddress2 = ""> <cfset customer.shipCity = ""> <cfset customer.shipState = ""> <cfset customer.shipZip = ""> <cfset customer.shipCountry = ""> <cfset customer.shipDayPhone = ""> <cfelse> <!--- Do something else ---> </cfif> <cfreturn customer> </cffunction> </cfcomponent> |
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and why? Paul Giesenhagen
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Jay Gibb
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Leo Schuman
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which... Dave Cordes
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Marcantonio Silva
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which... Barney Boisvert
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Knight, Matt
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Hardy Jonck
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Rob Brooks-Bilson
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Marcantonio Silva
- [CFCDev] Length of a CFC Dave Cordes
