MFDataSchema Class Reference

Inherits from NSObject
Declared in MFDataSchema.h
MFDataSchema.m

Overview

The MFDataSchema class is a local representation of schema persisted to the Mesosfer cloud. This is the main class that is used to interact with objects in your app.

  bucket

Specifies the bucket name of schema.

@property (strong, nonatomic, readonly, nullable) NSString *bucket

Declared In

MFDataSchema.h

  columns

Specifies the list of MFColumn of schema.

@property (strong, nonatomic, readonly, nonnull) NSArray<MFColumn*> *columns

Declared In

MFDataSchema.h

  objectId

Specifies the unique id of schema.

@property (strong, nonatomic, readonly, nullable) NSString *objectId

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFDataSchema.h

  createdAt

Specifies the created timestamp of schema.

@property (strong, nonatomic, readonly, nullable) NSDate *createdAt

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFDataSchema.h

  updatedAt

Specifies the last updated timestamp of schema.

@property (strong, nonatomic, readonly, nullable) NSDate *updatedAt

Discussion

This field will be assigned by fetching current object that exists or by saving new user to Mesosfer cloud.

Declared In

MFDataSchema.h

+ schemaWithBucket:NS_SWIFT_NAME:

Creates schema with bucket name.

+ (nonnull instancetype)schemaWithBucket:(nonnull NSString *)bucket NS_SWIFT_NAME

Parameters

bucket

The bucket name.

Return Value

A new schema object.

Declared In

MFDataSchema.h

+ schemaWithObjectId:NS_SWIFT_NAME:

Creates a reference to an existing MFDataSchema for use in creating associations between MFDataSchemas.

+ (nonnull instancetype)schemaWithObjectId:(nonnull NSString *)objectId NS_SWIFT_NAME

Parameters

objectId

The object id for the referenced MFDataSchema object.

Return Value

A new instance object without data.

Discussion

Warning: You need to call MFDataSchema.fetchAsyncWithBlock: to fetch object from Mesosfer cloud.

Declared In

MFDataSchema.h

+ query

Creates a new MFQuery instance for querying MDataSchema objects.

+ (nonnull MFQuery *)query

Return Value

A new MFQuery instance.

Declared In

MFDataSchema.h

+ queryWithBucket:

Creates a new MFQuery instance for querying MDataSchema objects using bucket name.

+ (nonnull MFQuery *)queryWithBucket:(nonnull NSString *)bucket

Parameters

bucket

The bucket name to query.

Return Value

A new MFQuery instance.

Declared In

MFDataSchema.h

– dictionary

Gets all key and value pair of MFData object in a dictionary.

- (nullable NSDictionary *)dictionary

Return Value

The dictionary of all key and value pair object.

Declared In

MFDataSchema.h

– addColumnWithName:andType:

Adds a schema column with name and MFObjectType.

- (nonnull instancetype)addColumnWithName:(nonnull NSString *)name andType:(MFObjectType)type

Parameters

name

The name of column.

type

The MFObjectType of column.

Return Value

The current instance of schema. This allow method chaining.

Declared In

MFDataSchema.h

– deleteColumnWithName:

Deletes a schema column with name.

- (nonnull instancetype)deleteColumnWithName:(nonnull NSString *)name

Parameters

name

The name of column.

Return Value

The current instance of schema. This allow method chaining.

Declared In

MFDataSchema.h

– fetchAsyncWithBlock:

Fetch the current MFDataSchema data from Mesosfer cloud asynchronously and executes the given callback block.

- (void)fetchAsyncWithBlock:(nullable MFDataSchemaResultBlock)block

Parameters

block

The block to execute. It shoud have the following argument signature: ^(MFDataSchema *schema, NSError *error).

Declared In

MFDataSchema.h

– saveAsyncWithBlock:

Saves the MFDataSchema asynchronously and executes the given callback block.

- (void)saveAsyncWithBlock:(nullable MFBooleanResultBlock)block

Parameters

block

The block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

Declared In

MFDataSchema.h

– deleteAsyncWithBlock:

Delete the MFDataSchema object in Mesosfer cloud asynchronously and executes the given callback block.

- (void)deleteAsyncWithBlock:(nullable MFBooleanResultBlock)block

Parameters

block

The block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

Declared In

MFDataSchema.h