overseer-js-sdk
Version:
This SDK for Overseer.
33 lines (31 loc) • 956 B
JavaScript
(function () {
this.Contacts = function () {}
Contacts.prototype = Object.create(Collection.prototype);
Contacts.prototype.constructor = Contacts;
Contacts.prototype.model = function (attributes) {
return new Contact(attributes);
}
Contacts.prototype.emails = function (attributes) {
return this.where('type', 'email');
}
Contacts.prototype.phones = function (attributes) {
return this.where('type', 'phone');
}
}());
(function () {
this.Contact = function (attributes) {
this.attributes = {};
this.oldAttributes = {};
this.fillable = {
id: 'integer',
type: 'string',
uid: 'string',
created_at: 'date',
updated_at: 'date',
};
this.relations = {};
this.fill(attributes);
}
Contact.prototype = Object.create(Model.prototype);
Contact.prototype.constructor = Contact;
}());