2017-07-04 00:04:31 +02:00
|
|
|
//
|
|
|
|
// ArticleStatus+Database.swift
|
2019-07-09 07:20:57 +02:00
|
|
|
// NetNewsWire
|
2017-07-04 00:04:31 +02:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 7/3/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSDatabase
|
2018-07-24 03:29:08 +02:00
|
|
|
import Articles
|
2017-07-04 00:04:31 +02:00
|
|
|
|
|
|
|
extension ArticleStatus {
|
|
|
|
|
2017-09-18 22:17:30 +02:00
|
|
|
convenience init(articleID: String, dateArrived: Date, row: FMResultSet) {
|
2017-07-04 00:04:31 +02:00
|
|
|
let read = row.bool(forColumn: DatabaseKey.read)
|
|
|
|
let starred = row.bool(forColumn: DatabaseKey.starred)
|
2020-04-13 02:12:36 +02:00
|
|
|
|
|
|
|
self.init(articleID: articleID, read: read, starred: starred, dateArrived: dateArrived)
|
2017-07-04 00:04:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-08-21 07:43:46 +02:00
|
|
|
extension ArticleStatus: DatabaseObject {
|
|
|
|
|
|
|
|
public var databaseID: String {
|
2018-02-14 22:14:25 +01:00
|
|
|
return articleID
|
2017-08-21 07:43:46 +02:00
|
|
|
}
|
2017-09-13 22:29:52 +02:00
|
|
|
|
2019-03-03 01:17:06 +01:00
|
|
|
public func databaseDictionary() -> DatabaseDictionary? {
|
2020-04-13 02:12:36 +02:00
|
|
|
return [DatabaseKey.articleID: articleID, DatabaseKey.read: read, DatabaseKey.starred: starred, DatabaseKey.dateArrived: dateArrived]
|
2017-09-13 22:29:52 +02:00
|
|
|
}
|
2017-09-16 20:04:29 +02:00
|
|
|
}
|
|
|
|
|