* 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)
| 2169 | * @returns {Model|Array<Model>} |
| 2170 | */ |
| 2171 | static build(values, options) { |
| 2172 | if (Array.isArray(values)) { |
| 2173 | return this.bulkBuild(values, options); |
| 2174 | } |
| 2175 | |
| 2176 | return new this(values, options); |
| 2177 | } |
| 2178 | |
| 2179 | static bulkBuild(valueSets, options) { |
| 2180 | options = { isNewRecord: true, ...options }; |