Implement DAO unsetAttribute
This commit is contained in:
parent
1705bd0f7f
commit
3b81b928fb
|
@ -1113,6 +1113,15 @@ DataAccessObject.prototype.setAttributes = function setAttributes(data) {
|
|||
Model.emit('set', inst);
|
||||
};
|
||||
|
||||
DataAccessObject.prototype.unsetAttribute = function unsetAttribute(name, nullify) {
|
||||
if (nullify) {
|
||||
this[name] = this.__data[name] = null;
|
||||
} else {
|
||||
delete this[name];
|
||||
delete this.__data[name];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update set of attributes.
|
||||
* Performs validation before updating.
|
||||
|
|
Loading…
Reference in New Issue