Changeset 8891
- Timestamp:
- 04/29/08 16:49:55 (4 months ago)
- Files:
-
- sandbox/minibase/trunk/demo/model.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/minibase/trunk/demo/model.js
r8890 r8891 11 11 function Book(properties) { 12 12 13 // Define any instance methods you like, accessing persistent 14 // properties using the this prefix. 13 15 this.getFullTitle = function() { 14 16 return this.author + ": " + this.title; … … 19 21 the following instance methods and properties: 20 22 21 save() - save the instance in the associated store22 remove() - remove the instance in the associated store23 _type - the object type name - readonly24 _id - the object id - undefined for transient objects,23 book.save() - save the instance in the associated store 24 book.remove() - remove the instance in the associated store 25 book._type - the object type name - readonly 26 book._id - the object id - undefined for transient objects, 25 27 only settable if undefined 26 28 */ … … 34 36 methods in the constructor: 35 37 36 get(id) - get a persistent object of this type by id37 all() - get an array containing all objects of this type38 filter() - not yet implemented38 Book.get(id) - get a persistent object of this type by id 39 Book.all() - get an array containing all objects of this type 40 Book.filter() - not yet implemented 39 41 */ 40 42 db.store.registerType(Book);