mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-20 00:24:01 +01:00
renamed ImportableObject and ImportableUniqueObject protocol methods to Swift 3 naming style
This commit is contained in:
@@ -62,14 +62,23 @@ public protocol ImportableObject: class {
|
||||
- parameter transaction: the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.
|
||||
- returns: `true` if an object should be created from `source`. Return `false` to ignore.
|
||||
*/
|
||||
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool
|
||||
static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool
|
||||
|
||||
/**
|
||||
Implements the actual importing of data from `source`. Implementers should pull values from `source` and assign them to the receiver's attributes. Note that throwing from this method will cause subsequent imports that are part of the same `importObjects(:sourceArray:)` call to be cancelled.
|
||||
|
||||
- parameter source: the object to import from
|
||||
- parameter transaction: the transaction that invoked the import. Use the transaction to fetch or create related objects if needed.
|
||||
*/
|
||||
*/
|
||||
func didInsert(from source: ImportSource, in transaction: BaseDataTransaction) throws
|
||||
|
||||
|
||||
// MARK: Deprecated
|
||||
|
||||
@available(*, deprecated: 3.0.0, renamed: "shouldInsert(from:in:)")
|
||||
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool
|
||||
|
||||
@available(*, deprecated: 3.0.0, renamed: "didInsert(from:in:)")
|
||||
func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws
|
||||
}
|
||||
|
||||
@@ -78,8 +87,21 @@ public protocol ImportableObject: class {
|
||||
|
||||
public extension ImportableObject {
|
||||
|
||||
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool {
|
||||
static func shouldInsert(from source: ImportSource, in transaction: BaseDataTransaction) -> Bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
// MARK: Deprecated
|
||||
|
||||
static func shouldInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) -> Bool {
|
||||
|
||||
return Self.shouldInsert(from: source, in: transaction)
|
||||
}
|
||||
|
||||
func didInsertFromImportSource(_ source: ImportSource, inTransaction transaction: BaseDataTransaction) throws {
|
||||
|
||||
try self.didInsert(from: source, in: transaction)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user