createControllers method

String createControllers()

Creates model of tables

Implementation

String createControllers() {
  if (_m.formTables!.isEmpty) {
    return '';
  }
  // print('createControllers() started');
  final modelString = MyStringBuffer()..writeln('// BEGIN CONTROLLERS');
  for (var table in _m.formTables!) {
    modelString
      ..printToDebug('CREATE CONTROLLER FOR TABLE: ${table.tableName}')
      ..writeln(SqfEntityControllerBuilder(table, _m.formTables!)
          .toControllersCode()
          .toString());
  }

  modelString.writeln('// END OF CONTROLLERS');
  print('SQFENTITY: [databaseTables] Controllers was created successfully. ');
  return modelString.toString();
}