LocalStore Class
Store that used in offline mode by default.
Item Index
Properties
Methods
adapterFor
-
modelName
Returns an instance of the adapter for a given type. Offline adapters should have name with postfix '-offline'.
Parameters:
-
modelNameStringThe name of the model type.
batchUpdate
-
models
Calls the save method on each passed model and returns a promise that is resolved by an array of saved models.
The array which fulfilled the promise may contain the following values:
same model object- for created, updated or unaltered records.null- for deleted records.
Parameters:
-
modelsDS.Model[] | DS.ModelIs array of models or single model for batch update.
Returns:
A promise that fulfilled with an array of models in the new state.
deleteRecord
-
modelName -
filter
Delete all record from the current store.
findAll
-
modelName -
[options]
Finds the records for the given model type.
See findAll for details.
Parameters:
Returns:
Records promise.
findRecord
-
modelName -
id -
[options]
Returns a record for a given type and id combination.
See findRecord for details.
Parameters:
Returns:
Record promise.
query
-
modelName -
query
This method delegates a query to the adapter.
See query for details.
Parameters:
Returns:
A promise, which is resolved with a RecordArray once the server returns.
queryRecord
-
modelName -
query
This method delegates a query to the adapter.
See queryRecord for details.
Parameters:
Returns:
A promise, which is resolved with a DS.RecordObject once the server returns.
serializerFor
-
modelName
Returns an instance of the serializer for a given type. Offline serializers should have name with postfix '-offline'.
Parameters:
-
modelNameStringThe name of the model type.
Flexberry Documentation