Skip to content

Commit

Permalink
add containsId
Browse files Browse the repository at this point in the history
  • Loading branch information
frank06 committed May 8, 2024
1 parent 79be054 commit 23a4c23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/model/relationship/has_many.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class HasMany<E extends DataModelMixin<E>> extends Relationship<E, Set<E>> {
return _contains(element);
}

bool containsId(Object id) {
final key = _adapter.core.getKeyForId(_internalType, id);
return _keys.contains(key);
}

/// Removes a [value] from this [Relationship]
bool remove(E value) {
return _remove(value);
Expand Down

0 comments on commit 23a4c23

Please sign in to comment.