Files
SideStore/AltStoreCore/Model/ManagedPatron.swift
Riley Testut aa8dd80e54 Adds (Managed)Patron Core Data entity
Will be used to cache Friend Zone patrons separately than the existing PatreonAccount entity.
2022-04-18 15:25:27 -07:00

38 lines
924 B
Swift

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