Files
SideStore/Sources/SideStoreCore/Model/ManagedPatron.swift

33 lines
883 B
Swift
Raw Normal View History

//
// ManagedPatron.swift
// AltStoreCore
//
// Created by Riley Testut on 4/18/22.
// Copyright © 2022 Riley Testut. All rights reserved.
//
import CoreData
@objc(ManagedPatron)
2023-03-01 00:48:36 -05:00
public class ManagedPatron: NSManagedObject, Fetchable {
@NSManaged public var name: String
@NSManaged public var identifier: String
2023-03-01 00:48:36 -05:00
override private init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?) {
super.init(entity: entity, insertInto: context)
}
2023-03-01 00:48:36 -05:00
public init(patron: Patron, context: NSManagedObjectContext) {
super.init(entity: ManagedPatron.entity(), insertInto: context)
2023-03-01 00:48:36 -05:00
name = patron.name
identifier = patron.identifier
}
}
2023-03-01 00:48:36 -05:00
public extension ManagedPatron {
@nonobjc class func fetchRequest() -> NSFetchRequest<ManagedPatron> {
NSFetchRequest<ManagedPatron>(entityName: "Patron")
}
}