detach method

Future<int> detach(
  1. String name, [
  2. Object? ids
])
inherited

Detaches ids (or all) through a BelongsToMany relation name.

Implementation

Future<int> detach(String name, [Object? ids]) {
  final relation = modelDefinition.requireRelation(name);
  if (relation is! BelongsToMany<Model>) {
    throw StateError('Relation [$name] is not BelongsToMany.');
  }
  return relation.detach(this, database, ids);
}