2017-09-13 21:41:01 -07:00
|
|
|
//
|
|
|
|
// RelatedObjectsMap+Database.swift
|
|
|
|
// Database
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 9/13/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RSDatabase
|
2018-07-23 18:29:08 -07:00
|
|
|
import Articles
|
2017-09-13 21:41:01 -07:00
|
|
|
|
|
|
|
extension RelatedObjectsMap {
|
|
|
|
|
|
|
|
func attachments(for articleID: String) -> Set<Attachment>? {
|
|
|
|
|
|
|
|
if let objects = self[articleID] {
|
|
|
|
return objects.asAttachments()
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func authors(for articleID: String) -> Set<Author>? {
|
|
|
|
|
|
|
|
if let objects = self[articleID] {
|
|
|
|
return objects.asAuthors()
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|