Model Configuration
protectedProperties()
Signature
Section titled “Signature”protectedProperties() — returns void
Available in: model
Category: Miscellaneous Functions
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 | no | — | Property name (or list of property names) that are not allowed to be altered through mass assignment. |
Examples
Section titled “Examples”// In `models/User.cfc`, `firstName` and `lastName` cannot be changed through mass assignment operations like `updateAll()`.
function config(){
protectedProperties("firstName,lastName");
}