Inherits from NSObject
Declared in APConnection.h

Overview

A Connection is represents an edge in a graph and is used to connect two APObjects. A Connection itself can store data in its properties and attributes fields.

Tasks

Other Methods

Getting the APConnection

Searching for APConnections

Create APConnections

Fetch APConnections

Delete APConnections

Methods to store key-value pairs

Properties

articleAId

@property (nonatomic, strong) NSNumber *articleAId

articleBId

@property (nonatomic, strong) NSNumber *articleBId

attributes

@property (nonatomic, strong, readonly) NSMutableArray *attributes

createdBy

@property (nonatomic, strong) NSString *createdBy

labelA

@property (nonatomic, strong) NSString *labelA

labelB

@property (nonatomic, strong) NSString *labelB

lastModifiedBy

@property (nonatomic, strong, readonly) NSString *lastModifiedBy

objectId

@property (nonatomic, strong) NSNumber *objectId

properties

@property (nonatomic, strong, readonly) NSMutableArray *properties

relationId

@property (nonatomic, strong) NSNumber *relationId

relationType

@property (nonatomic, strong) NSString *relationType

revision

@property (nonatomic, strong, readonly) NSNumber *revision

tags

@property (nonatomic, strong) NSArray *tags

utcDateCreated

@property (nonatomic, strong, readonly) NSDate *utcDateCreated

utcLastModifiedDate

@property (nonatomic, strong, readonly) NSDate *utcLastModifiedDate

Class Methods

connectionWithRelationType:

Initialize and return an APConnection for the provided relation type.

+ (id)connectionWithRelationType:(NSString *)relationType

Parameters

relationType

The name of the relation. This is specified while creating the schema.

Discussion

Initialize and return an APConnection for the provided relation type.

Declared In

APConnection.h

deleteConnectionsWithRelationType:objectIds:

+ (void)deleteConnectionsWithRelationType:(NSString *)relationType objectIds:(NSArray *)objectIds

Declared In

APConnection.h

deleteConnectionsWithRelationType:objectIds:failureHandler:

+ (void)deleteConnectionsWithRelationType:(NSString *)relationType objectIds:(NSArray *)objectIds failureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

deleteConnectionsWithRelationType:objectIds:successHandler:failureHandler:

Deletes multiple APConnections.

+ (void)deleteConnectionsWithRelationType:(NSString *)relationType objectIds:(NSArray *)objectIds successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

relationType

The name of the relation. Connections of this relation name will be deleted.

objectIds

An array of objectIds. APConnections having these object ids will be deleted.

successBlock

Block invoked when the delete call is successful.

failureBlock

Block invoked when the delete call fails.

Discussion

Deletes multiple APConnections.

Declared In

APConnection.h

fetchConnectionWithRelationType:objectId:successHandler:

+ (void)fetchConnectionWithRelationType:(NSString *)relationType objectId:(NSNumber *)objectId successHandler:(APResultSuccessBlock)successBlock

Declared In

APConnection.h

fetchConnectionWithRelationType:objectId:successHandler:failureHandler:

Fetch an APConnection of a particular relation type.

+ (void)fetchConnectionWithRelationType:(NSString *)relationType objectId:(NSNumber *)objectId successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

relationType

The name of the relation. A connection of this relation name is retrieved.

objectId

The id of the connection to retrieve.

successBlock

Block invoked when the fetch call is successful. The block returns the results in the form of a JSON.

failureBlock

Block invoked when the fetch call operation fails.

Discussion

Fetch an APConnection of a particular relation type.

Declared In

APConnection.h

fetchConnectionsWithRelationType:objectIds:successHandler:

fetchConnectionsWithRelationType:objectId:successHandler:failureHandler:

+ (void)fetchConnectionsWithRelationType:(NSString *)relationType objectIds:(NSArray *)objectIds successHandler:(APResultSuccessBlock)successBlock

Declared In

APConnection.h

fetchConnectionsWithRelationType:objectIds:successHandler:failureHandler:

Fetches multiple APConnections from the remote server.

+ (void)fetchConnectionsWithRelationType:(NSString *)relationType objectIds:(NSArray *)objectIds successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

relationType

The name of the relation. Connections of this relation are retrieved.

objectIds

An array of objectIds. Connections with these object ids are fetched.

successBlock

Block invoked when the fetch call is successful. The block returns the results in the form of a JSON.

failureBlock

Block invoked when the fetch call operation fails.

Discussion

Fetches multiple APConnections from the remote server.

Declared In

APConnection.h

searchForAllConnectionsWithRelationType:successHandler:

+ (void)searchForAllConnectionsWithRelationType:(NSString *)relationType successHandler:(APResultSuccessBlock)successBlock

Declared In

APConnection.h

searchForAllConnectionsWithRelationType:successHandler:failureHandler:

Search for all APConnections of a particular relation type.

+ (void)searchForAllConnectionsWithRelationType:(NSString *)relationType successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

relationType

The relation type that the connections should belong to.

successBlock

Block invoked when the search call is successful.

failureBlock

Block invoked when the search call fails.

Discussion

Search for all APConnections of a particular relation type.

Declared In

APConnection.h

searchForConnectionsWithRelationType:withQueryString:successHandler:

+ (void)searchForConnectionsWithRelationType:(NSString *)relationType withQueryString:(NSString *)queryString successHandler:(APResultSuccessBlock)successBlock

Declared In

APConnection.h

searchForConnectionsWithRelationType:withQueryString:successHandler:failureHandler:

Searches for APConnections and filters the result according to the query provided.

+ (void)searchForConnectionsWithRelationType:(NSString *)relationType withQueryString:(NSString *)queryString successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

relationType

The relation type that the connections should belong to.

queryString

SQL kind of query to search for specific objects. For more info http://appacitive.com

successBlock

Block invoked when the search call is successful.

failureBlock

Block invoked when the search call fails.

Discussion

Searches for APConnections and filters the result according to the query provided.

Declared In

APConnection.h

Instance Methods

addAttributeWithKey:value:

Method used to add an attibute to the APObject. Attributes are used to store extra information.

- (void)addAttributeWithKey:(NSString *)keyName value:(id)object

Parameters

keyName

key of the data item to be stored.

object

Corresponding value to the key.

Discussion

Method used to add an attibute to the APObject. Attributes are used to store extra information.

Declared In

APConnection.h

addPropertyWithKey:value:

Method used to add a property to the APObject.

- (void)addPropertyWithKey:(NSString *)keyName value:(id)object

Parameters

keyName

key of the data item to be stored.

object

Corresponding value to the key.

Discussion

Method used to add a property to the APObject.

Declared In

APConnection.h

createConnectionWithFailureHandler:

- (void)createConnectionWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

createConnectionWithObjectA:objectB:

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB

Declared In

APConnection.h

createConnectionWithObjectA:objectB:failureHandler:

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB failureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

createConnectionWithObjectA:objectB:labelA:labelB:

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB labelA:(NSString *)labelA labelB:(NSString *)labelB

Declared In

APConnection.h

createConnectionWithObjectA:objectB:labelA:labelB:failureHandler:

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB labelA:(NSString *)labelA labelB:(NSString *)labelB failureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

createConnectionWithObjectA:objectB:labelA:labelB:successHandler:failureHandler:

Creates an APConnection between two APObjects. The labels on either side of the connection are specified as parameters.

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB labelA:(NSString *)labelA labelB:(NSString *)labelB successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

objectA

The article to create a connection from.

objectB

The article to create a connection to.

labelA

The label at the starting vertex of the connection.

successBlock

Block invoked when the create operation is successful.

failureBlock

Block invoked when the create operation fails.

lablelB

The label at the end vertex of the connection.

Discussion

Creates an APConnection between two APObjects. The labels on either side of the connection are specified as parameters.

Declared In

APConnection.h

createConnectionWithObjectA:objectB:successHandler:failureHandler:

Creates an APConnection between two APObjects.

- (void)createConnectionWithObjectA:(APObject *)objectA objectB:(APObject *)objectB successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

objectA

The article to create a connection from.

objectB

The article to create a connection to.

successBlock

Block invoked when the create operation is successful.

failureBlock

Block invoked when the create operation fails.

Discussion

Creates an APConnection between two APObjects.

This method will set labelA and labelB as the schemaName of objectA and objectB.

Declared In

APConnection.h

createConnectionWithObjectAId:objectBId:labelA:labelB:

- (void)createConnectionWithObjectAId:(NSNumber *)objectAId objectBId:(NSNumber *)objectBId labelA:(NSString *)labelA labelB:(NSString *)labelB

Declared In

APConnection.h

createConnectionWithObjectAId:objectBId:labelA:labelB:failureHandler:

- (void)createConnectionWithObjectAId:(NSNumber *)objectAId objectBId:(NSNumber *)objectBId labelA:(NSString *)labelA labelB:(NSString *)labelB failureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

createConnectionWithObjectAId:objectBId:labelA:labelB:successHandler:failureHandler:

Creates an APConnection between two APObjects.

- (void)createConnectionWithObjectAId:(NSNumber *)objectAId objectBId:(NSNumber *)objectBId labelA:(NSString *)labelA labelB:(NSString *)labelB successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

objectAId

The id of the APObject to create a connection from.

objectBId

The id of the APObject to create a connection to.

labelA

The label at the starting vertex of the connection.

labelB

The label at the end vertex of the connection.

failureHandler

Block invoked when the create operation fails.

successHandler

Block invoked when the create operation is successful.

Discussion

Creates an APConnection between two APObjects.

Declared In

APConnection.h

createConnectionWithSuccessHandler:failureHandler:

Create an APConnection between two APObjects on the remote server.

- (void)createConnectionWithSuccessHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

successBlock

Block invoked when the create operation is successful.

failureBlock

Block invoked when the create operation fails.

Discussion

Create an APConnection between two APObjects on the remote server.

This method requires the articleAId, articleBId, labelA and labelB properties to be set.

Declared In

APConnection.h

deleteConnection

- (void)deleteConnection

Declared In

APConnection.h

deleteConnectionWithFailureHandler:

- (void)deleteConnectionWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APConnection.h

deleteConnectionWithSuccessHandler:failureHandler:

Deletes an APConnection.

- (void)deleteConnectionWithSuccessHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

successBlock

Block invoked when delete is successful.

failureBlock

Block invoked when delete fails.

Discussion

Deletes an APConnection.

This method requires the relationType and objectId to be set.

Declared In

APConnection.h

initWithRelationType:

Initialize and return an APConnection for the provided relation type.

- (id)initWithRelationType:(NSString *)relationType

Parameters

relationType

The name of the relation. This is specified while creating the schema.

Discussion

Initialize and return an APConnection for the provided relation type.

Declared In

APConnection.h