HTML and CSS Reference
In-Depth Information
* This will return an object with a specific id for a specific type.
* If no object is found this will return null
*
* @param {String} type The type of object that should be searched for.
* @param {String|number} id The unique ID of the object
* @param {Function} successCallback The callback that will be invoked after the query completes. This will be passed
an object conforming to the requested type or null.
* @param {Function} errorCallback The callback that will be invoked on error scenarios.
*/
function findById(type, id, successCallback, errorCallback)
/**
* This will handle adding and editing objects of a specific type.
* If the id property of the object passed in is null or undefined, an id will be assigned for the object, and it will be saved.
* If the id property is non-null then the object will be updated.
* If the id cannot be found the error callback will be invoked.
* On success, the newly saved object will be returned to the success callback.
*
* @param {String} type The type of object that will be stored.
* @param {Object} obj The object that will be stored.
* @param {Function} successCallback The callback that will be invoked after the object has been committed to the stor-
age engine. This will be the stored object, including the id property.
* @param {Function} errorCallback The callback that will be invoked on error scenarios.
*/
function save(type, obj, successCallback, errorCallback)
/*
* This will delete an object with a specific id for a specific type.
* If no object exists with that id, the error callback will be invoked.
* If an object is deleted this function will return the id of the deleted object to the successCallback
*
* @param {String} type The type of object that will be deleted.
* @param {String|number} id The unique id of the object.
* @param {Function} successCallback The callback that will be invoked after the object has been deleted from the stor-
age engine. This will be passed the unique id of the deleted object.
* @param {Function} errorCallback The callback that will be invoked on error scenarios.
Search WWH ::




Custom Search