Skip to content

Model Object

update()

update() — returns boolean

Available in: model Category: CRUD Functions

Updates the object with the supplied properties and saves it to the database. Returns true if the object was saved successfully to the database and false otherwise.

NameTypeRequiredDefaultDescription
propertiesstructno[runtime expression]The properties you want to set on the object (can also be passed in as named arguments).
parameterizeanynotrueSet to true to use cfqueryparam on all columns, or pass in a list of property names to use cfqueryparam on those only.
reloadbooleannofalseSet to true to force Wheels to query the database even though an identical query for this model may have been run in the same request. (The default in Wheels is to get the second query from the model’s request-level cache.)
validatebooleannotrueSet to false to skip validations for this operation.
transactionstringno[runtime expression]Set this to commit to update the database, rollback to run all the database queries but not commit them, or none to skip transaction handling altogether.
callbacksbooleannotrueSet to false to disable callbacks for this method.
allowExplicitTimestampsbooleannofalseSet this to true to allow explicit assignment of createdAt or updatedAt properties