Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var Photo, Photos, Album, Albums;
Photo = Y.Base.create('photo', Y.Model, [], {}, {
ATTRS: {
imgUrl: {},
caption: {}
}
});
Photos = Y.Base.create('photos', Y.ModelList, [], {model: Photo});
Album = Y.Base.create('album', Y.Model, [], {
initializer: function () {
this._photos = new Y.Photos();
},
_getPhotos: function () {
return this._photos;
},
_setPhotos: function (photos) {
return this._photos.reset(photos);
}
}, {
ATTRS: {
name: {},
photos: {
getter : '_getPhotos',
setter : '_setPhotos',
validator: Y.Lang.isArray
}
}
});
Albums = Y.Base.create('albums', Y.ModelList, [], {model: Album});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment