-
Title computed by implementations of the Item class
Declaration
Swift
@objc dynamic var computedTitle: String { get } -
Undocumented
Declaration
Swift
var computedVars: [ComputedPropertyLink] { get } -
Undocumented
Declaration
Swift
var functions: [String : (_ args: [Any?]?) -> Any?] -
Primary key used in the realm database of this Item
Declaration
Swift
override public static func primaryKey() -> String? -
Declaration
Swift
override public var description: String { get } -
Undocumented
See moreDeclaration
Swift
enum ItemError : Error -
Undocumented
Declaration
Swift
var changelog: Results<AuditItem>? { get } -
Declaration
Swift
required init() -
Undocumented
Declaration
Swift
required init(from _: Decoder) throws -
Undocumented
Declaration
Swift
public func cast() -> Self -
Get string, or string representation (e.g. “true) from property name
Declaration
Swift
public func getString(_ name: String) -> String?Parameters
nameproperty name
Return Value
string representation
-
Get the type of Item
Declaration
Swift
public func getType() -> Item.Type?Return Value
type of the Item
-
Determines whether item has property
Declaration
Swift
public func hasProperty(_ propName: String) -> BoolParameters
propNamename of the property
Return Value
boolean indicating whether Item has the property
-
Get property value
Declaration
Swift
public func get<T>(_ name: String, type _: T.Type = T.self) -> T?Parameters
nameproperty name
-
Set property to value, which will be persisted in the local database
Declaration
Swift
public func set(_ name: String, _ value: Any?)Parameters
nameproperty name
valuevalue
-
Undocumented
Declaration
Swift
public func reverseEdges(_ edgeType: String) -> Results<Edge>? -
Undocumented
Declaration
Swift
public func reverseEdge(_ edgeType: String) -> Edge? -
Undocumented
Declaration
Swift
public func edges(_ edgeType: String) -> Results<Edge>? -
Undocumented
Declaration
Swift
public func edges(_ edgeTypes: [String]) -> Results<Edge>? -
Undocumented
Declaration
Swift
public func edge(_ edgeType: String) -> Edge? -
Undocumented
Declaration
Swift
public func edge(_ edgeTypes: [String]) -> Edge? -
When distinct is set to false multiple of the same relationship type are allowed
Declaration
Swift
public func link( _ item: Object, type edgeType: String = "edge", sequence: EdgeSequencePosition? = nil, label: String? = nil, distinct: Bool = false, overwrite: Bool = true ) throws -> Edge? -
Undocumented
Declaration
Swift
public func unlink(_ edge: Edge) throws -
Undocumented
Declaration
Swift
public func unlink(_ item: Item, type edgeType: String? = nil, all: Bool = true) throws -
Toggle boolean property
Declaration
Swift
public func toggle(_ name: String) throwsParameters
nameproperty name
-
Compares value of this Items property with the corresponding property of the passed items property
Declaration
Swift
public func isEqualProperty(_ propName: String, _ item: Item) -> BoolParameters
propNamename of the compared property
itemitem to compare against
Return Value
boolean indicating whether the property values are the same
-
Undocumented
Declaration
Swift
func isEqualValue(_ a: Any?, _ b: Any?) -> Bool -
Safely merges the passed item with the current Item. When there are merge conflicts, meaning that some other process requested changes for the same properties with different values, merging is not performed.
Declaration
Swift
public func safeMerge(_ item: Item) -> BoolParameters
itemitem to be merged with the current Item
Return Value
boolean indicating the succes of the merge
-
merges the the passed Item in the current item
Declaration
Swift
public func merge(_ item: Item, _ mergeDefaults: Bool = false)Parameters
itempassed Item
mergeDefaultsboolean describing how to merge. If mergeDefault == true: Overwrite only the property values have not already been set (nil). else: Overwrite all property values with the values from the passed item, with the exception that values cannot be set from a non-nil value to nil.
-
update the dateAccessed property to the current date
Declaration
Swift
public func accessed() -
update the dateAccessed property to the current date
Declaration
Swift
public func modified(_ updatedFields: [String]) -
compare two dataItems
Declaration
Swift
public static func == (lhs: Item, rhs: Item) -> BoolParameters
lhsItem 1
rhsItem 2
Return Value
boolean indicating equality
-
Reads Items from file
Throws
Decoding errorDeclaration
Swift
public class func fromJSONFile(_ file: String, ext: String = "json") throws -> [Item]Parameters
filefilename (without extension)
extextension
Return Value
Array of deserialized Items
-
Read Item from string
Throws
Decoding errorDeclaration
Swift
public class func fromJSONString(_ json: String) throws -> [Item]Parameters
jsonstring to parse
Return Value
Array of deserialized Items
Item Class Reference