You are viewing documentation for v1.1.x. Change

compareTo()

Description

Pass in another Wheels model object to see if the two objects are the same.

Function Syntax

compareTo()

Parameters

None.

Examples

<!--- Load a user requested in the URL/form and restrict access if it doesn't match the user stored in the session --->
<cfset user = model("user").findByKey(params.key)>
<cfif not user.compareTo(session.user)>
    <cfset renderPage(action="accessDenied")>
</cfif>