Model Object
setProperties()
Signature
Section titled “Signature”setProperties() — returns void
Available in: model
Category: Miscellaneous Functions
Description
Section titled “Description”Allows you to set all the properties of an object at once by passing in a structure with keys matching the property names.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
properties | struct | no | [runtime expression] | The properties you want to set on the object (can also be passed in as named arguments). |
Examples
Section titled “Examples”// Update the properties of the object with the params struct containing the values of a form post
user = model("user").findByKey(1);
user.setProperties(params.user);