<cfset user = entityLoad("users",{userId=GetAuthUser()},false)>
Should instead be:
<cfset user = entityLoad("users",{userId=GetAuthUser()},true)>
Otherwise entityload returns an array of users and you only want one.
Seth
Hi,
I have started using ORM and trying convert my codes into ORM capable however i have this error.
My code is:
<cfset user = entityLoad("users",{userId=GetAuthUser()},false)>
<cfif IsNull(user) >
<cfset errorMsg = "Incorect current password, please try again." >
<cfelse>
<cfset user.setPassword("#form.password#")>
<cfset entitySave(user)>
</cfif>
My CFC is:
<cfcomponent persistent="true" table="tblusers">
<cfproperty name="keyColumn" generator="increment">
<cfproperty name="userid" ormtype="string">
<cfproperty name="password" ormtype="string">
<cfproperty name="name" ormtype="string">
<cfproperty name="trade" ormtype="string">
<cfproperty name="email" ormtype="string">
<cfproperty name="status" ormtype="string">
<cfproperty name="role" ormtype="string">
<cfproperty name="type" ormtype="string">
<cfproperty name="IP" ormtype="string">
<cfproperty name="createdBy" ormtype="integer">
<cfproperty name="updatedAt" ormtype="date">
</cfcomponent>
The Error is:
The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request
The setPassword method was not found.
Either there are no methods with the specified method name and argument types or the setPassword method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cf-orm-dev+...@googlegroups.com.
To post to this group, send email to cf-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cf-orm-dev+...@googlegroups.com.
To post to this group, send email to cf-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.