$$CategoryTableTableManager constructor
$$CategoryTableTableManager(
- _$SharedDatabase db,
- $CategoryTable table
Implementation
$$CategoryTableTableManager(_$SharedDatabase db, $CategoryTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$CategoryTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$CategoryTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$CategoryTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> code = const Value.absent(),
Value<String> name = const Value.absent(),
Value<String?> imagePath = const Value.absent(),
Value<String?> description = const Value.absent(),
}) => CategoryCompanion(
id: id,
code: code,
name: name,
imagePath: imagePath,
description: description,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required String code,
required String name,
Value<String?> imagePath = const Value.absent(),
Value<String?> description = const Value.absent(),
}) => CategoryCompanion.insert(
id: id,
code: code,
name: name,
imagePath: imagePath,
description: description,
),
withReferenceMapper: (p0) => p0
.map(
(e) => (
e.readTable(table),
$$CategoryTableReferences(db, table, e),
),
)
.toList(),
prefetchHooksCallback: ({productRefs = false}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [if (productRefs) db.product],
addJoins: null,
getPrefetchedDataCallback: (items) async {
return [
if (productRefs)
await $_getPrefetchedData<
CategoryData,
$CategoryTable,
ProductData
>(
currentTable: table,
referencedTable: $$CategoryTableReferences
._productRefsTable(db),
managerFromTypedResult: (p0) =>
$$CategoryTableReferences(db, table, p0).productRefs,
referencedItemsForCurrentItem: (item, referencedItems) =>
referencedItems.where((e) => e.categoryId == item.id),
typedResults: items,
),
];
},
);
},
),
);