Inherits from NSObject
Declared in APObject.h
APObject.m

Overview

An APObject is a basic unit to store information in. It represents an instance of a schema. Data can be stored in key-value pairs in the properties and attributes fields.

Tasks

Getting the APObject

Searching for APObjects

Deleting APObjects

Fetch APObjects

Methods to store key-value pairs

Save APObjects

Update APObjects

Apply graph queries

Class Methods

applyFilterGraphQuery:successHandler:

+ (void)applyFilterGraphQuery:(NSString *)query successHandler:(APResultSuccessBlock)successBlock

Declared In

APObject.h

applyFilterGraphQuery:successHandler:failureHandler:

Searches for APObjects that satisfy the filter graph query.

+ (void)applyFilterGraphQuery:(NSString *)query successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

query

A string representing the filter graph query.

successBlock

Block invoked when query is successfully executed.

failureBlock

Block invoked when query execution fails.

Discussion

A filter query is a kind that does not have a starting point in the graph. All the APObjects that satisfy the query will be returned. To know more visit http://wwww.appacitive.com

Declared In

APObject.h

applyProjectionGraphQuery:successHandler:

+ (void)applyProjectionGraphQuery:(NSString *)query successHandler:(APResultSuccessBlock)successBlock

Declared In

APObject.h

applyProjectionGraphQuery:successHandler:failureHandler:

Searches for APObjects that satisfy the projection graph query.

+ (void)applyProjectionGraphQuery:(NSString *)query successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

query

A string representing the projection graph query.

successBlock

Block invoked when query is successfully executed.

failureBlock

Block invoked when query execution fails.

Discussion

A projection query will search for results from a starting node in the graph. To know more visit http://wwww.appacitive.com

Declared In

APObject.h

deleteObjectsWithIds:schemaName:failureHandler:

+ (void)deleteObjectsWithIds:(NSArray *)objectIds schemaName:(NSString *)schemaName failureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

deleteObjectsWithIds:schemaName:successHandler:failureHandler:

Deletes multiple APObjects.

+ (void)deleteObjectsWithIds:(NSArray *)objectIds schemaName:(NSString *)schemaName successHandler:(APSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

objectIds

The ids of the objects to delete.

schemaName

The schema that the objects belong to.

successBlock

Block invoked when the multi delete operation succeeds.

failureBlock

Block invoked when the multi delete operation fails.

Declared In

APObject.h

fetchObjectWithObjectId:schemaName:successHandler:failureHandler:

+ (void)fetchObjectWithObjectId:(NSNumber *)objectId schemaName:(NSString *)schemaName successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

fetchObjectsWithObjectIds:schemaName:successHandler:failureHandler:

Retrieves multiple APObjects of a particular schema.

+ (void)fetchObjectsWithObjectIds:(NSArray *)objectIds schemaName:(NSString *)schemaName successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

objectIds

The ids of the objects.

schemaName

The schema name the objects belong to.

successBlock

Block invoked when the retrieve operation succeeds.

failureBlock

Block invoked when the failure operation succeeds.

Declared In

APObject.h

objectWithSchemaName:

Initialize and return an autoreleased APObject for the provided schema name.

+ (id)objectWithSchemaName:(NSString *)schemaName

Parameters

schemaName

The schema this article represents.

Declared In

APObject.h

searchAllObjectsWithSchemaName:successHandler:

+ (void)searchAllObjectsWithSchemaName:(NSString *)schemaName successHandler:(APResultSuccessBlock)successBlock

Declared In

APObject.h

searchAllObjectsWithSchemaName:successHandler:failureHandler:

Searches for all APObjects of a particular schema.

+ (void)searchAllObjectsWithSchemaName:(NSString *)schemaName successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

schemaName

The schema that the objects should belong to.

successBlock

Block invoked when the search call is successful.

failureBlock

Block invoked when search call fails.

Declared In

APObject.h

searchObjectsWithSchemaName:withQueryString:successHandler:

+ (void)searchObjectsWithSchemaName:(NSString *)schemaName withQueryString:(NSString *)queryString successHandler:(APResultSuccessBlock)successBlock

Declared In

APObject.h

searchObjectsWithSchemaName:withQueryString:successHandler:failureHandler:

Searches for APObjects and filters the results according to the query string.

+ (void)searchObjectsWithSchemaName:(NSString *)schemaName withQueryString:(NSString *)queryString successHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

schemaName

The schema of the objects you want to search.

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.

Declared In

APObject.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.

Declared In

APObject.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.

Declared In

APObject.h

deleteObject

- (void)deleteObject

Declared In

APObject.h

deleteObjectWithConnectingConnections

- (void)deleteObjectWithConnectingConnections

Declared In

APObject.h

deleteObjectWithConnectingConnections:

- (void)deleteObjectWithConnectingConnections:(APFailureBlock)failureBlock

Declared In

APObject.h

deleteObjectWithConnectingConnectionsSuccessHandler:failureHandler:

Deletes an APObject along with any connections it has.

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

Parameters

successBlock

Block invoked when delete operation is successful

failureBlock

Block invoked when delete operation is unsuccessful

Declared In

APObject.h

deleteObjectWithFailureHandler:

- (void)deleteObjectWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

deleteObjectWithSuccessHandler:failureHandler:

Deletes and APObject.

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

Parameters

successBlock

Block invoked when delete operation is successful

failureBlock

Block invoked when delete operation fails.

Discussion

This method will delete the object on the remote server. It will not nullify the current properties or attributes.

Declared In

APObject.h

fetch

- (void)fetch

Declared In

APObject.h

fetchWithFailureHandler:

- (void)fetchWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

fetchWithSuccessHandler:failureHandler:

Method used to fetch an APObject.

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

Parameters

failureBlock

Block invoked when the fetch operation fails.

Discussion

This method will use the schemaType and objectId properties to fetch the article. If the objectId and schemaType is not set, results are unexpected.

Declared In

APObject.h

getPropertyWithKey:

Method used to retrieve a property using its key.

- (id)getPropertyWithKey:(NSString *)keyName

Parameters

keyName

key of the date item to be removed.

Declared In

APObject.h

initWithSchemaName:

Initialize and return an autoreleased APObject for the provided schema name.

- (id)initWithSchemaName:(NSString *)schemaName

Parameters

schemaName

The schema this article represents.

Declared In

APObject.h

removeAttributeWithKey:

Method used to remove an attribute. Call update after this method call to persist the change

- (void)removeAttributeWithKey:(NSString *)keyName

Parameters

keyName

key of the attribute to be removed.

Declared In

APObject.h

removePropertyWithKey:

Method used to delete a property. Call update after this method call to persist the change.

- (void)removePropertyWithKey:(NSString *)keyName

Parameters

keyName

key of the data item to be removed.

Declared In

APObject.h

saveObject

- (void)saveObject

Declared In

APObject.h

saveObjectWithFailureHandler:

- (void)saveObjectWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

saveObjectWithSuccessHandler:failureHandler:

Save the article on the remote server.

- (void)saveObjectWithSuccessHandler:(APResultSuccessBlock)successBlock failureHandler:(APFailureBlock)failureBlock

Parameters

successBlock

Block invoked when the save operation is successful

failureBlock

Block invoked when the save operation fails.

Discussion

This method will save an article in the background. If save is successful the properties will be updated and the successBlock will be invoked. If not the failure block is invoked.

Declared In

APObject.h

updateAttributeWithKey:value:

Method used to update an attribute. Call update after this method call to persist the change

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

Parameters

keyName

key of the attribute to be updated.

object

Corresponding value to the key.

Declared In

APObject.h

updateObject

- (void)updateObject

Declared In

APObject.h

updateObjectWithFailureHandler:

- (void)updateObjectWithFailureHandler:(APFailureBlock)failureBlock

Declared In

APObject.h

updateObjectWithSuccessHandler:failureHandler:

Method used to update an APObject.

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

Parameters

successBlock

Block invoked when the update operation is successful.

failureBlock

Block invoked when the update operation fails.

Declared In

APObject.h

updatePropertyWithKey:value:

Method used to update an existing property. Call update after this method call to persist the update.

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

Parameters

keyName

key of the data item to be updated.

object

Corresponding value to the key.

Declared In

APObject.h