new StorageManager()
Storage manager handles the storage and retrieval of items.
Methods
(static) self.all()
Queries all items in the storage container.
Returns:
An array of items
(static) self.byId(id)
Queries for an item by identifier.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The identifier of the item |
Returns:
The item
(static) self.clear()
Clear the item queue.
(static) self.init(options)
Initialize the storage manager.
Parameters:
Name | Type | Description |
---|---|---|
options |
object | A dictionary of options to configure the storage manager |
Returns:
The storage manager
(static) self.transform(raw)
Transforms the raw object to a specifec model. Subclasses should override
this method.
Parameters:
Name | Type | Description |
---|---|---|
raw |
Object | The JSON object |
Returns:
The item
(static) self.update(id, properties)
Update the status of an item.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The identifier of the item |
properties |
object | The item properties |