toCompanion method

TeachersCompanion toCompanion(
  1. bool nullToAbsent
)

Implementation

TeachersCompanion toCompanion(bool nullToAbsent) {
  return TeachersCompanion(
    id: Value(id),
    fetchedAt: fetchedAt == null && nullToAbsent
        ? const Value.absent()
        : Value(fetchedAt),
    code: Value(code),
    semester: Value(semester),
    nameZh: Value(nameZh),
    nameEn: nameEn == null && nullToAbsent
        ? const Value.absent()
        : Value(nameEn),
    email: email == null && nullToAbsent
        ? const Value.absent()
        : Value(email),
    department: department == null && nullToAbsent
        ? const Value.absent()
        : Value(department),
    title: title == null && nullToAbsent
        ? const Value.absent()
        : Value(title),
    teachingHours: teachingHours == null && nullToAbsent
        ? const Value.absent()
        : Value(teachingHours),
    officeHoursNote: officeHoursNote == null && nullToAbsent
        ? const Value.absent()
        : Value(officeHoursNote),
  );
}