(input, options)
| 583 | } |
| 584 | |
| 585 | static ensureModelArray(input, options) { |
| 586 | if (!input) { |
| 587 | return []; |
| 588 | } |
| 589 | |
| 590 | if (Array.isArray(input)) { |
| 591 | const models = new Array(input.length); |
| 592 | |
| 593 | for (let i = 0, l = input.length; i < l; ++i) { |
| 594 | models[i] = this.ensureModel(input[i], options); |
| 595 | } |
| 596 | |
| 597 | return models; |
| 598 | } else { |
| 599 | return [this.ensureModel(input, options)]; |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | static getRelationUnsafe(name) { |
| 604 | const mapping = this.getRelationMappings()[name]; |