Miscellaneous
validateOnUpdate()
Signature
Section titled “Signature”validateOnUpdate() — returns any
Description
Section titled “Description”Registers method(s) that should be called to validate existing objects before they are updated.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
methods | string | yes | — | See documentation for validate. |
condition | string | yes | — | See documentation for validatesConfirmationOf. |
unless | string | yes | — | See documentation for validatesConfirmationOf. |
Examples
Section titled “Examples”<cffunction name="init">
<cfscript>
// Register the `check` method below to be called to validate existing objects before they are updated
validateOnUpdate("checkPhoneNumber");
</cfscript>
</cffunction>
<cffunction name="checkPhoneNumber">
<cfscript>
// Make sure area code is `614`
return Left(this.phoneNumber, 3) == "614";
</cfscript>
</cffunction>