Slide 19
Slide 19 text
var ClipEntity = module.exports = EntityBase.extendSingleton(function() {
this.setModel(clipModel.Model);
this.method('readOneApi', this.readOne);
this.method('readLimitApi', this.readLimit);
this.method('updateApi', this.update);
this.method('readApi', this.read);
// Apply system wide (global) filters
this.readLimitApi.before(this.systemFilter.bind(this));
this.readOneApi.before(this.systemFilter.bind(this));
// Clip Creation middleware
this.create.before(this._populateActiveEvent.bind(this));
this.create.after(this._processNewClip.bind(this));
// Record sanitization middleware
this.updateApi.after(helpers.skipArgs(this.sanitizeResult, 2, this));
this.readLimitApi.after(helpers.skipArgs(this.sanitizeResults, 3, this));
this.readOneApi.after(helpers.skipArgs(this.sanitizeResult, 1, this));
});
A Production-ish Entity
A Production-ish Entity
@thanpolas