Implement DAO unsetAttribute
This commit is contained in:
parent
5dc7a6350c
commit
c19aca906d
|
@ -1113,6 +1113,15 @@ DataAccessObject.prototype.setAttributes = function setAttributes(data) {
|
||||||
Model.emit('set', inst);
|
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.
|
* Update set of attributes.
|
||||||
* Performs validation before updating.
|
* Performs validation before updating.
|
||||||
|
|
Loading…
Reference in New Issue