Miscellaneous
protectedProperties()
Signature
Section titled “Signature”protectedProperties() — returns any
Description
Section titled “Description”Use this method to specify which properties cannot be set through mass assignment.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
properties | string | yes | — | Property name (or list of property names) that are not allowed to be altered through mass assignment. |
Examples
Section titled “Examples”protectedProperties([ properties ]) <!--- In `models/User.cfc`, `firstName` and `lastName` cannot be changed through mass assignment operations like `updateAll()` --->
<cffunction name="init">
<cfset protectedProperties("firstName,lastName")>
</cffunction>