Model Class
new()
Signature
Section titled “Signature”new() — returns any
Available in: model
Category: Create Functions
Description
Section titled “Description”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.
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). |
callbacks | boolean | no | true | Set to false to disable callbacks for this method. |
allowExplicitTimestamps | boolean | no | false | Set this to true to allow explicit assignment of createdAt or updatedAt properties |