Inherits from NSObject
Declared in MMRecord.h
MMRecord.m

Overview

This class represents various user settable options that MMRecord will use when starting requests.

Tasks

  •   automaticallyPersistsRecords

    Starts requests and tethers the managed objects generated from the response to a child context of the one that is passed in rather than saving the objects directly to the persistent store. This option should be used when you want finer-grained control over the context saving behavior of the request. MMRecord will still call save on the underlying child context, as it assumes that the context you pass in is where you want the objects to go. It’s important to note that calling save on a child context only pushes the data up one layer, to the parent, unless the child has no parent, in which case it saves directly to the persistent store.

    property
  •   callbackQueue

    The queue that will be used by MMRecord when calling the result and failure blocks.

    property
  •   keyPathForResponseObject

    Must specify the key path where records are located within the response object. This will only be used if your response object is of type dictionary. This option gives you the ability to specify a different key path for an entity than the one in your subclass. Use this option sparingly. Generally speaking you should subclass and create a different entity to provide different functionality.

    property
  •   isRecordLevelCachingEnabled

    This option indicates whether records returned are cacheable. The record level cache is keyed by the request URL and will obey the HTTP cache control headers. For more information on caching please see above documentation.

    property
  •   keyPathForMetaData

    This option specifies the key path where metadata for the records are located within the response object. This will only be used if your response object is of type dictionary. Returning a non-nil value will short-circuit parsing the cached response body and build a subset of the response using this key and the value from the actual response. This option is provided purely for performance considerations and is not required.

    property
  •   pageManagerClass

    This option allows you to specify a page manager that will be used for the next request if it is paginated. This gives you the flexibility to use a different page manager class than is specified on your registered server class for a given entity. This may be useful if your API has different pagination behavior in certain situations.

    property
  •   debugger

    This option allows you to specify your own debugger class for implementing custom error handling behavior. You might want to do this if you want to override certain MMRecord errors, or more strictly enforce errors of your own. You may also be able to provide support for custom errors. The MMRecordDebugger class and error handling system may grow more powerful overtime, possibly obviating the need for this, but also possibly making this even more useful.

    property
  •   deleteOrphanedRecordBlock

    This option allows you to specify a block that will be executed once per record which was orphaned by this request’s response until either it has been called n times for n number of orphans or until you pass YES for the stop parameter.

    property
  •   entityPrimaryKeyInjectionBlock

    This option allows you to specify a block that will be executed when a record is populated and no primary key to identify it is found in the populating record dictionary. This allows you to return your own primary key that will be used to uniquely identify the record. You may also choose to generate a primary key for a given record based on the dictionary passed into the block. Hashing the dictionary to create the primary key may prove to be a valid solution for your specific use case.

    property
  •   recordPrePopulationBlock

    This option allows you to specify a block that will be executed immediately before record population in order to perform some task like inserting data into the population process.

    property

Properties

automaticallyPersistsRecords

Starts requests and tethers the managed objects generated from the response to a child context of the one that is passed in rather than saving the objects directly to the persistent store. This option should be used when you want finer-grained control over the context saving behavior of the request. MMRecord will still call save on the underlying child context, as it assumes that the context you pass in is where you want the objects to go. It’s important to note that calling save on a child context only pushes the data up one layer, to the parent, unless the child has no parent, in which case it saves directly to the persistent store.

@property (nonatomic, assign) BOOL automaticallyPersistsRecords

Discussion

Starts requests and tethers the managed objects generated from the response to a child context of the one that is passed in rather than saving the objects directly to the persistent store. This option should be used when you want finer-grained control over the context saving behavior of the request. MMRecord will still call save on the underlying child context, as it assumes that the context you pass in is where you want the objects to go. It’s important to note that calling save on a child context only pushes the data up one layer, to the parent, unless the child has no parent, in which case it saves directly to the persistent store.

@discussion This option defaults to YES.

Declared In

MMRecord.h

callbackQueue

The queue that will be used by MMRecord when calling the result and failure blocks.

@property (nonatomic) dispatch_queue_t callbackQueue

Discussion

The queue that will be used by MMRecord when calling the result and failure blocks.

@discussion The default callback queue is the main queue.

Declared In

MMRecord.h

debugger

This option allows you to specify your own debugger class for implementing custom error handling behavior. You might want to do this if you want to override certain MMRecord errors, or more strictly enforce errors of your own. You may also be able to provide support for custom errors. The MMRecordDebugger class and error handling system may grow more powerful overtime, possibly obviating the need for this, but also possibly making this even more useful.

@property (nonatomic, strong) MMRecordDebugger *debugger

Discussion

This option allows you to specify your own debugger class for implementing custom error handling behavior. You might want to do this if you want to override certain MMRecord errors, or more strictly enforce errors of your own. You may also be able to provide support for custom errors. The MMRecordDebugger class and error handling system may grow more powerful overtime, possibly obviating the need for this, but also possibly making this even more useful.

@discussion Default value for this is an instance of MMRecordDebugger.

Declared In

MMRecord.h

deleteOrphanedRecordBlock

This option allows you to specify a block that will be executed once per record which was orphaned by this request’s response until either it has been called n times for n number of orphans or until you pass YES for the stop parameter.

@property (nonatomic, copy) MMRecordOptionsDeleteOrphanedRecordBlock deleteOrphanedRecordBlock

Discussion

This option allows you to specify a block that will be executed once per record which was orphaned by this request’s response until either it has been called n times for n number of orphans or until you pass YES for the stop parameter.

This block will only be called for orphans of the initial entity type that was requested by MMRecord. Sub-entities or child-entities will not be considered as orphans.

@discussion Default value is nil which means orphans will be ignored.

Declared In

MMRecord.h

entityPrimaryKeyInjectionBlock

This option allows you to specify a block that will be executed when a record is populated and no primary key to identify it is found in the populating record dictionary. This allows you to return your own primary key that will be used to uniquely identify the record. You may also choose to generate a primary key for a given record based on the dictionary passed into the block. Hashing the dictionary to create the primary key may prove to be a valid solution for your specific use case.

@property (nonatomic, copy) MMRecordOptionsEntityPrimaryKeyInjectionBlock entityPrimaryKeyInjectionBlock

Discussion

This option allows you to specify a block that will be executed when a record is populated and no primary key to identify it is found in the populating record dictionary. This allows you to return your own primary key that will be used to uniquely identify the record. You may also choose to generate a primary key for a given record based on the dictionary passed into the block. Hashing the dictionary to create the primary key may prove to be a valid solution for your specific use case.

@discussion This block should return nil if you have no way to uniquely identify a record for the given type of entity. The default value of this option is nil.

Declared In

MMRecord.h

isRecordLevelCachingEnabled

This option indicates whether records returned are cacheable. The record level cache is keyed by the request URL and will obey the HTTP cache control headers. For more information on caching please see above documentation.

@property (nonatomic, assign) BOOL isRecordLevelCachingEnabled

Discussion

This option indicates whether records returned are cacheable. The record level cache is keyed by the request URL and will obey the HTTP cache control headers. For more information on caching please see above documentation.

@discussion Default value is NO.

Warning: This method is supported for batching, but may result in unintended entities being cached.

Declared In

MMRecord.h

keyPathForMetaData

This option specifies the key path where metadata for the records are located within the response object. This will only be used if your response object is of type dictionary. Returning a non-nil value will short-circuit parsing the cached response body and build a subset of the response using this key and the value from the actual response. This option is provided purely for performance considerations and is not required.

@property (nonatomic, copy) NSString *keyPathForMetaData

Discussion

This option specifies the key path where metadata for the records are located within the response object. This will only be used if your response object is of type dictionary. Returning a non-nil value will short-circuit parsing the cached response body and build a subset of the response using this key and the value from the actual response. This option is provided purely for performance considerations and is not required.

@discussion Default value is the value returned in the subclass method.

Declared In

MMRecord.h

keyPathForResponseObject

Must specify the key path where records are located within the response object. This will only be used if your response object is of type dictionary. This option gives you the ability to specify a different key path for an entity than the one in your subclass. Use this option sparingly. Generally speaking you should subclass and create a different entity to provide different functionality.

@property (nonatomic, copy) NSString *keyPathForResponseObject

Discussion

Must specify the key path where records are located within the response object. This will only be used if your response object is of type dictionary. This option gives you the ability to specify a different key path for an entity than the one in your subclass. Use this option sparingly. Generally speaking you should subclass and create a different entity to provide different functionality.

@discussion Default is whatever is returned by this method on the MMRecord subclass.

Warning: This option is NOT supported for batch requests!

Declared In

MMRecord.h

pageManagerClass

This option allows you to specify a page manager that will be used for the next request if it is paginated. This gives you the flexibility to use a different page manager class than is specified on your registered server class for a given entity. This may be useful if your API has different pagination behavior in certain situations.

@property (nonatomic, strong) Class pageManagerClass

Discussion

This option allows you to specify a page manager that will be used for the next request if it is paginated. This gives you the flexibility to use a different page manager class than is specified on your registered server class for a given entity. This may be useful if your API has different pagination behavior in certain situations.

@discussion Default value is the page manager for the registered server class for the given entity.

Declared In

MMRecord.h

recordPrePopulationBlock

This option allows you to specify a block that will be executed immediately before record population in order to perform some task like inserting data into the population process.

@property (nonatomic, copy) MMRecordOptionsRecordPrePopulationBlock recordPrePopulationBlock

Discussion

This option allows you to specify a block that will be executed immediately before record population in order to perform some task like inserting data into the population process.

@discussion Default value is nil which means population will be performed normally.

Declared In

MMRecord.h