set method

T? set(
  1. T? o
)

Sets the entity to o and returns the current entity.

Implementation

T? set(T? o) {
  if (identical(o, _entity)) return o;

  if (o == null) {
    _id = null;
    _entity = null;
    _entityTime = null;
  } else {
    var id = _getEntityID(o);
    _id = id;
    _entity = o;
    _entityTime = DateTime.now();
  }

  return _entity;
}