mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-09-10 11:52:00 +02:00
WIP
This commit is contained in:
@@ -110,6 +110,19 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
|
||||
return self.context.fetchExisting(object)
|
||||
}
|
||||
|
||||
/**
|
||||
Fetches the `DynamicObject` instance in the transaction's context from an `NSManagedObjectID`.
|
||||
|
||||
- parameter persistentID: the `DynamicObjectID` for the object
|
||||
- returns: the `DynamicObject` instance if the object exists in the transaction, or `nil` if not found.
|
||||
*/
|
||||
public func fetchExisting<O: DynamicObject>(
|
||||
_ persistentID: DynamicObjectID<O>
|
||||
) -> O? {
|
||||
|
||||
return self.context.fetchExisting(persistentID.managedObjectID)
|
||||
}
|
||||
|
||||
/**
|
||||
Fetches the `DynamicObject` instance in the transaction's context from an `NSManagedObjectID`.
|
||||
|
||||
@@ -136,6 +149,19 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
|
||||
return self.context.fetchExisting(objects)
|
||||
}
|
||||
|
||||
/**
|
||||
Fetches the `DynamicObject` instances in the transaction's context from a list of `DynamicObjectID`.
|
||||
|
||||
- parameter objectIDs: the `DynamicObjectID` array for the objects
|
||||
- returns: the `DynamicObject` array for objects that exists in the transaction
|
||||
*/
|
||||
public func fetchExisting<O: DynamicObject, S: Sequence>(
|
||||
_ objectIDs: S
|
||||
) -> [O] where S.Iterator.Element == DynamicObjectID<O> {
|
||||
|
||||
return self.context.fetchExisting(objectIDs)
|
||||
}
|
||||
|
||||
/**
|
||||
Fetches the `DynamicObject` instances in the transaction's context from a list of `NSManagedObjectID`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user