Models
Understand the purpose of application models
Introduction
Defining a Model
const { BO } = require ('@onehilltech/blueprint');
module.exports = BO.extend ({
id: null // message id
from: null, // who the message is from
to: null, // who the message is to
date: null, // date of the message
subject: null, // message subject
content: null, // content of the message
init () {
this._super.call (this, ...arguments);
if (!this.date) this.date = new Date ();
}
});Accessing a Model
Moving Forward
Last updated