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