mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-26 11:21:32 +01:00
Deprecation of legacy ValueContainer and RelationshipContainer properties in favor of @Field propertyWrapper counterpart
This commit is contained in:
@@ -189,7 +189,9 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Stored<V>>) -> V {
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, FieldContainer<OBase>.Stored<V>>
|
||||
) -> V {
|
||||
|
||||
get {
|
||||
|
||||
@@ -206,7 +208,9 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Virtual<V>>) -> V {
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, FieldContainer<OBase>.Virtual<V>>
|
||||
) -> V {
|
||||
|
||||
get {
|
||||
|
||||
@@ -223,7 +227,9 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Coded<V>>) -> V {
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, FieldContainer<OBase>.Coded<V>>
|
||||
) -> V {
|
||||
|
||||
get {
|
||||
|
||||
@@ -240,7 +246,9 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, FieldContainer<OBase>.Relationship<V>>) -> V.PublishedType {
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, FieldContainer<OBase>.Relationship<V>>
|
||||
) -> V.PublishedType {
|
||||
|
||||
get {
|
||||
|
||||
@@ -255,11 +263,19 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = V.cs_toSnapshotType(from: newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, ValueContainer<OBase>.Required<V>>) -> V {
|
||||
|
||||
// MARK: - Deprecated
|
||||
|
||||
@available(*, deprecated, message: """
|
||||
Legacy `Value.*`, `Transformable.*`, and `Relationship.*` declarations will soon be obsoleted. Please migrate your models and stores to new models that use `@Field.*` property wrappers. See: https://github.com/JohnEstropia/CoreStore?tab=readme-ov-file#new-field-property-wrapper-syntax
|
||||
""")
|
||||
extension ObjectSnapshot where O: CoreStoreObject {
|
||||
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, ValueContainer<OBase>.Required<V>>
|
||||
) -> V {
|
||||
|
||||
get {
|
||||
|
||||
@@ -273,10 +289,9 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, ValueContainer<OBase>.Optional<V>>) -> V? {
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, ValueContainer<OBase>.Optional<V>>
|
||||
) -> V? {
|
||||
|
||||
get {
|
||||
|
||||
@@ -289,11 +304,10 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Required<V>>) -> V {
|
||||
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Required<V>>
|
||||
) -> V {
|
||||
|
||||
get {
|
||||
|
||||
@@ -306,11 +320,10 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, V>(dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Optional<V>>) -> V? {
|
||||
|
||||
public subscript<OBase, V>(
|
||||
dynamicMember member: KeyPath<O, TransformableContainer<OBase>.Optional<V>>
|
||||
) -> V? {
|
||||
|
||||
get {
|
||||
|
||||
@@ -323,11 +336,10 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = newValue
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToOne<D>>) -> ObjectPublisher<D>? {
|
||||
|
||||
public subscript<OBase, D>(
|
||||
dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToOne<D>>
|
||||
) -> ObjectPublisher<D>? {
|
||||
|
||||
get {
|
||||
|
||||
@@ -344,11 +356,10 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = newValue?.objectID()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyOrdered<D>>) -> [ObjectPublisher<D>] {
|
||||
|
||||
public subscript<OBase, D>(
|
||||
dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyOrdered<D>>
|
||||
) -> [ObjectPublisher<D>] {
|
||||
|
||||
get {
|
||||
|
||||
@@ -363,11 +374,10 @@ extension ObjectSnapshot where O: CoreStoreObject {
|
||||
self.values[key] = newValue.map({ $0.objectID() })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<OBase, D>(dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyUnordered<D>>) -> Set<ObjectPublisher<D>> {
|
||||
|
||||
public subscript<OBase, D>(
|
||||
dynamicMember member: KeyPath<O, RelationshipContainer<OBase>.ToManyUnordered<D>>
|
||||
) -> Set<ObjectPublisher<D>> {
|
||||
|
||||
get {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user