Class ManyArray
| Extends: | EmberObject |
|---|---|
| Uses: | DeprecatedEvented , | Ember.MutableArray
| Defined in: | ../model/addon/-private/system/many-array.js:14 |
| Module: | @ember-data/store |
A ManyArray is a MutableArray that represents the contents of a has-many relationship.
The ManyArray is instantiated lazily the first time the relationship is requested.
Inverses
Often, the relationships in Ember Data applications will have an inverse. For example, imagine the following models are defined:
app/models/post.jsimport Model, { hasMany } from '@ember-data/model';
export default class PostModel extends Model {
@hasMany('comment') comments;
} app/models/comment.jsimport Model, { belongsTo } from '@ember-data/model';
export default class CommentModel extends Model {
@belongsTo('post') post;
} If you created a new instance of Post and added a Comment record to its comments has-many relationship, you would expect the comment's post property to be set to the post that contained the has-many.
We call the record to which a relationship belongs-to the relationship's owner.
Methods
Properties
Events
No documented items
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember-data/3.25/classes/ManyArray