setAttributesFrom method
Bulk-updates this entity’s attributes from another entity if whenSet is older. Only non-identifier attributes are considered. Returns true if all updated.
Implementation
bool setAttributesFrom(Entity entity) {
bool allSet = true;
if (entity.whenSet?.millisecondsSinceEpoch != null &&
whenSet?.millisecondsSinceEpoch != null &&
(whenSet!.millisecondsSinceEpoch <
entity.whenSet!.millisecondsSinceEpoch)) {
for (Attribute attribute in _concept!.nonIdentifierAttributes) {
var newValue = entity.getAttribute(attribute.code);
var attributeSet = setAttribute(attribute.code, newValue);
if (!attributeSet) {
allSet = false;
}
}
} else {
allSet = false;
}
return allSet;
}