CLASS

# RoomleDataManager

Contents

  • Properties
    • delegate
  • Methods
    • syncCatalogs(type:)
    • isSyncing()
    • getCatalogs(resolvedConnections:)
    • getCatalog(with:resolvedConnections:)
    • getProductCatalogCategory(resolvedConnections:)
    • getRoomCatalogCategory(resolvedConnections:)
public class RoomleDataManager : NSObject

Can access all possible catalog based data like catalogs, categories and items.

# Properties

# delegate

public weak var delegate : RoomleDataManagerDelegate? = nil

Delegate which is called, if a catalog sync is finished for example.

# Methods

# syncCatalogs(type:)

public func syncCatalogs(type: RoomleCatalogSyncTypes = .quick)

Start a new catalog sync with given type to query all visible catalogs for your tenant. If no type is given .quick will be default sync type.

  • parameter type: type which decides which elements are going to be synced.

# Parameters

Name Description
type type which decides which elements are going to be synced.

# isSyncing()

public func isSyncing() -> Bool

Property determines if a catalog sync is already running

# getCatalogs(resolvedConnections:)

public func getCatalogs(resolvedConnections: RoomleDataManagerResolvedConnections = .none) -> [RoomleCatalog]

Get all synced catalogs.

IMPORTANT if no resolvedConnection is set - .none will be used, which means that no items and categories are associated to returned catalogs. This is made in order to save performance and memory.

  • parameter resolvedConnections: describes which connections should be resolved

# Parameters

Name Description
resolvedConnections describes which connections should be resolved

# getCatalog(with:resolvedConnections:)

public func getCatalog(with id : String, resolvedConnections: RoomleDataManagerResolvedConnections = .all) -> RoomleCatalog?

Returns a catalog based on given id. Catalog will have all associated items and categories attached, if no resolvedConnection is set - .all will be used.

  • parameter id: id of the catalog which will be returned, if found
  • parameter resolvedConnections: describes which connections should be resolved

# Parameters

Name Description
id id of the catalog which will be returned, if found
resolvedConnections describes which connections should be resolved

# getProductCatalogCategory(resolvedConnections:)

public func getProductCatalogCategory(resolvedConnections: RoomleDataManagerResolvedConnections = .all) -> RoomleCatalogCategory?

Returns "products" category if it already got synced. If no resolvedConnection is set - .all will be used.

  • parameter resolvedConnections: describes which connections should be resolved

# Parameters

Name Description
resolvedConnections describes which connections should be resolved

# getRoomCatalogCategory(resolvedConnections:)

public func getRoomCatalogCategory(resolvedConnections: RoomleDataManagerResolvedConnections = .all) -> RoomleCatalogCategory?

Returns "rooms" category if it already got synced. If no resolvedConnection is set - .all will be used.

  • parameter resolvedConnections: describes which connections should be resolved

# Parameters

Name Description
resolvedConnections describes which connections should be resolved