toCompanion method

ProductCompanion toCompanion(
  1. bool nullToAbsent
)

Implementation

ProductCompanion toCompanion(bool nullToAbsent) {
  return ProductCompanion(
    id: Value(id),
    name: Value(name),
    price: Value(price),
    active: Value(active),
    imagePath: imagePath == null && nullToAbsent
        ? const Value.absent()
        : Value(imagePath),
    categoryId: Value(categoryId),
    estimatedInputPrice: Value(estimatedInputPrice),
    taxRate: Value(taxRate),
    description: description == null && nullToAbsent
        ? const Value.absent()
        : Value(description),
  );
}