2017-07-17 04:36:38 +02:00
|
|
|
//
|
2017-07-17 05:51:08 +02:00
|
|
|
// AttachmentsTable.swift
|
2017-07-17 04:36:38 +02:00
|
|
|
// Database
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 7/15/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSDatabase
|
2018-07-24 03:29:08 +02:00
|
|
|
import Articles
|
2017-07-17 04:36:38 +02:00
|
|
|
|
2017-09-02 19:13:37 +02:00
|
|
|
final class AttachmentsTable: DatabaseRelatedObjectsTable {
|
2017-07-17 04:36:38 +02:00
|
|
|
|
2017-07-29 21:08:10 +02:00
|
|
|
let name: String
|
2017-08-21 02:46:15 +02:00
|
|
|
let databaseIDKey = DatabaseKey.attachmentID
|
2017-09-13 06:47:04 +02:00
|
|
|
var cache = DatabaseObjectCache()
|
2017-07-29 21:13:38 +02:00
|
|
|
|
2017-08-21 00:56:58 +02:00
|
|
|
init(name: String) {
|
2017-07-29 21:08:10 +02:00
|
|
|
|
|
|
|
self.name = name
|
|
|
|
}
|
2017-07-17 05:51:08 +02:00
|
|
|
|
2017-09-13 06:19:45 +02:00
|
|
|
// MARK: DatabaseRelatedObjectsTable
|
|
|
|
|
2017-08-21 02:46:15 +02:00
|
|
|
func objectWithRow(_ row: FMResultSet) -> DatabaseObject? {
|
2017-09-16 22:10:03 +02:00
|
|
|
|
|
|
|
if let attachment = Attachment(row: row) {
|
2017-08-21 07:43:46 +02:00
|
|
|
return attachment as DatabaseObject
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2017-07-17 04:36:38 +02:00
|
|
|
}
|
2017-09-13 06:19:45 +02:00
|
|
|
|