Skip to content

Commit 23a4c23

Browse files
committed
add containsId
1 parent 79be054 commit 23a4c23

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/model/relationship/has_many.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ class HasMany<E extends DataModelMixin<E>> extends Relationship<E, Set<E>> {
5353
return _contains(element);
5454
}
5555

56+
bool containsId(Object id) {
57+
final key = _adapter.core.getKeyForId(_internalType, id);
58+
return _keys.contains(key);
59+
}
60+
5661
/// Removes a [value] from this [Relationship]
5762
bool remove(E value) {
5863
return _remove(value);

0 commit comments

Comments
 (0)