Skip to content

Model Class

new()

new() — returns any

Available in: model Category: Create Functions

Creates a new object based on supplied properties and returns it. The object is not saved to the database, it only exists in memory. Property names and values can be passed in either using named arguments or as a struct to the properties argument.

NameTypeRequiredDefaultDescription
propertiesstructno[runtime expression]The properties you want to set on the object (can also be passed in as named arguments).
callbacksbooleannotrueSet to false to disable callbacks for this method.
allowExplicitTimestampsbooleannofalseSet this to true to allow explicit assignment of createdAt or updatedAt properties