readByIds method

Future<HGrid> readByIds(
  1. List<HRef> ids, {
  2. bool checked = true,
})
inherited

Reads a list of entity records by their unique identifier.

Returns a grid where each row of the grid maps to the respective id array (indexes line up). If checked is true and any one of the ids cannot be resolved then raise UnknownRecException for first id not resolved. If checked is false, then each id not found has a row where every cell is null.

Implementation

Future<HGrid> readByIds(List<HRef> ids, {bool checked = true}) {
  return onReadByIds(ids).then((HGrid grid) {
    if (checked) {
      for (int i = 0; i < grid.numRows; ++i) {
        if (grid.row(i).missing("id")) throw UnknownRecError(id: ids[i]);
      }
    }
    return grid;
  });
}