$$CustomerTableTableManager constructor

$$CustomerTableTableManager(
  1. _$SharedDatabase db,
  2. $CustomerTable table
)

Implementation

$$CustomerTableTableManager(_$SharedDatabase db, $CustomerTable table)
  : super(
      TableManagerState(
        db: db,
        table: table,
        createFilteringComposer: () =>
            $$CustomerTableFilterComposer($db: db, $table: table),
        createOrderingComposer: () =>
            $$CustomerTableOrderingComposer($db: db, $table: table),
        createComputedFieldComposer: () =>
            $$CustomerTableAnnotationComposer($db: db, $table: table),
        updateCompanionCallback:
            ({
              Value<int> id = const Value.absent(),
              Value<String> code = const Value.absent(),
              Value<String> name = const Value.absent(),
              Value<bool> vip = const Value.absent(),
              Value<String?> address = const Value.absent(),
              Value<String?> phone = const Value.absent(),
              Value<String> email = const Value.absent(),
              Value<String?> imagePath = const Value.absent(),
            }) => CustomerCompanion(
              id: id,
              code: code,
              name: name,
              vip: vip,
              address: address,
              phone: phone,
              email: email,
              imagePath: imagePath,
            ),
        createCompanionCallback:
            ({
              Value<int> id = const Value.absent(),
              required String code,
              required String name,
              required bool vip,
              Value<String?> address = const Value.absent(),
              Value<String?> phone = const Value.absent(),
              required String email,
              Value<String?> imagePath = const Value.absent(),
            }) => CustomerCompanion.insert(
              id: id,
              code: code,
              name: name,
              vip: vip,
              address: address,
              phone: phone,
              email: email,
              imagePath: imagePath,
            ),
        withReferenceMapper: (p0) => p0
            .map(
              (e) => (
                e.readTable(table),
                $$CustomerTableReferences(db, table, e),
              ),
            )
            .toList(),
        prefetchHooksCallback: ({salesOrderRefs = false}) {
          return PrefetchHooks(
            db: db,
            explicitlyWatchedTables: [if (salesOrderRefs) db.salesOrder],
            addJoins: null,
            getPrefetchedDataCallback: (items) async {
              return [
                if (salesOrderRefs)
                  await $_getPrefetchedData<
                    CustomerData,
                    $CustomerTable,
                    SalesOrderData
                  >(
                    currentTable: table,
                    referencedTable: $$CustomerTableReferences
                        ._salesOrderRefsTable(db),
                    managerFromTypedResult: (p0) => $$CustomerTableReferences(
                      db,
                      table,
                      p0,
                    ).salesOrderRefs,
                    referencedItemsForCurrentItem: (item, referencedItems) =>
                        referencedItems.where((e) => e.customerId == item.id),
                    typedResults: items,
                  ),
              ];
            },
          );
        },
      ),
    );