* Builds a new model instance. * * @param {object|Array} values An object of key value pairs or an array of such. If an array, the function will return an array of instances. * @param {object} [options] Instance build options * @param {boolean} [options.raw=false] If set to true, values
(values, options)
| 2248 | * @returns {Model|Array<Model>} |
| 2249 | */ |
| 2250 | static build(values, options) { |
| 2251 | if (Array.isArray(values)) { |
| 2252 | return this.bulkBuild(values, options); |
| 2253 | } |
| 2254 | |
| 2255 | return new this(values, options); |
| 2256 | } |
| 2257 | |
| 2258 | static bulkBuild(valueSets, options) { |
| 2259 | options = { isNewRecord: true, ...options }; |