Sha256: 8dfc105051c8d1fe3ea8c63e56e644247aeacb6ae2aa385bc5f3a54011d67ea6

Contents?: true

Size: 1.84 KB

Versions: 7

Compression:

Stored size: 1.84 KB

Contents

/**
 * Method  Collection Individual
 * create  yes        yes  (but different)
 * build   yes        yes
 * find    yes        no
 * loaded  yes        yes  (but different)
 * count   yes        no
 * destroy yes        yes  (but different)
 */

/**
 * Method  HasMany BelongsTo
 * create  yes     no
 * build   yes     no
 * destroy yes     yes
 * find    yes     yes
 */

/**
 * User.find(1, {
 *   success: function(user) {
 *     //on belongs to associations
 *     user.group.destroy();
 *     user.group.find({success: function(group) {}});
 *     user.group.set(someGroupInstance); //someGroupInstance must be a saved record (e.g. have an ID)
 * 
 *     //on has many associations
 *     user.posts.destroy(1);
 *     user.posts.find({id: 1, conditions: [{field: 'title', comparator: '=', value: 'some title'}]}, options);
 *     user.posts.create(data, options)
 *     user.posts.build(data)
 *   }
 * };
 */

// ExtMVC.Model.define('User', {
//   fields:  [],
//   belongsTo: "Group",
//   hasMany: [{
//     name:       'posts',
//     className:  'Post',
//     foreignKey: 'user_id',
//     
//     extend: {
//       //some functions
//     }
//   }]
// });
// 
// user.posts.find(1, {
//   success: function() {},
//   failure: function() {}
// });
// 
// user.posts.create({}, {
//   success: function() {},
//   failure: function() {}
// });
// 
// user.posts.build({});
// 
// user.posts.loaded();
// user.posts.count();
// user.posts.destroy(1);
// 
// ExtMVC.Model.define('Post', {
//   fields:    [],
//   belongsTo: [{
//     name:       'user',
//     className:  'User',
//     foreignKey: 'user_id',
//     
//     extend: {
//       //some functions
//     }
//   }],
//   hasMany: 'Comment'
// });
// 
// post.user.find();
// post.user.loaded();
// post.user.destroy();
// 
// ExtMVC.Model.define('Comment', {
//   fields:    [],
//   belongsTo: "Post"
// });

Version data entries

7 entries across 6 versions & 1 rubygems

Version Path
extjs-mvc-0.4.0.k test/app/vendor/extjs-mvc/model/associations/notes.txt
extjs-mvc-0.4.0.k lib/extjs-mvc/src/model/associations/notes.txt
extjs-mvc-0.4.0.f lib/src/model/associations/notes.txt
extjs-mvc-0.4.0.e lib/vendor/model/associations/notes.txt
extjs-mvc-0.4.0.d lib/vendor/model/associations/notes.txt
extjs-mvc-0.4.0.b lib/js/model/associations/notes.txt
extjs-mvc-0.4.0.a lib/js/model/associations/notes.txt