fromEntity static method

NUITableRow? fromEntity(
  1. NUIEnt entity
)

Implementation

static NUITableRow? fromEntity(NUIEnt entity){
  if(entity.mapper().fields().isNullOrEmpty()) return null;

  final cells = <NUITableCell>[];
  for(NUIEntField field in entity.mapper().fields()){
    if(field.type == NUIEntType.STRING || field.type == NUIEntType.DOUBLE || field.type == NUIEntType.DATE || field.type == NUIEntType.INTEGER || field.type == NUIEntType.BOOLEAN) {
      print("Entity field name : ${field.name}");
      cells.add(NUITableCell(value: field.runGetter(entity), type: field.type));
    }
  }
  print("Number of cells is : ${cells.length}");
  return NUITableRow(cells);
}