This commit is contained in:
John Estropia
2026-07-15 11:50:43 +09:00
parent 7db1cfecfb
commit 890e150b95
135 changed files with 2895 additions and 2526 deletions
+26
View File
@@ -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`.