Skip to content

Collection Entity Class Definition

EntitySpaces edited this page Jan 27, 2012 · 2 revisions
es.EsEntityCollection = function () {

	// Public Methods
	acceptChanges();      // rarely used
	addNew();             // adds a new entity and returns it
	rejectChanges();      // rollback any changes
	applyDefaults();      // override to assign defaults to columns
	isDirty();            // does this entity have changes
	isDirtyGraph();       // does this entire object graph have changes
	loadAll();            // loads all records from the associate table
        markAsDeleted()       // Pass in one or more entities, or an an array of entities
	markAllAsDeleted();   // marks all entities in the collection as deleted
	save();               // save this entity (and the entire graph)

	// Protected Methods
	load();               // called by your custom load methods
	populateCollection(); // load by passing in data (not recommended)
};