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

protectedProperties()

Description

Use this method to specify which properties cannot be set through mass assignment.

Function Syntax

protectedProperties([ properties ])

Parameters

Parameter Type Required Default Description
properties string No Property name (or list of property names) that are not allowed to be altered through mass assignment.

Examples

<!--- In `models/User.cfc`, `firstName` and `lastName` cannot be changed through mass assignment operations like `updateAll()` --->
<cffunction name="init">
    <cfset protectedProperties("firstName,lastName")>
</cffunction>