5 // Created by Heberti Almeida on 11/08/15.
6 // Copyright (c) 2015 Folio Reader. All rights reserved.
12 /// A Highlight object
13 open class Highlight: Object {
14 @objc open dynamic var bookId: String!
15 @objc open dynamic var content: String!
16 @objc open dynamic var contentPost: String!
17 @objc open dynamic var contentPre: String!
18 @objc open dynamic var date: Date!
19 @objc open dynamic var highlightId: String!
20 @objc open dynamic var page: Int = 0
21 @objc open dynamic var type: Int = 0
22 @objc open dynamic var startOffset: Int = -1
23 @objc open dynamic var endOffset: Int = -1
25 override open class func primaryKey()-> String {
31 func toArray<T>(_ ofType: T.Type) -> [T] {
32 return flatMap { $0 as? T }