DS.AdapterPopulatedRecordArray Class addon/-private/system/record-arrays/adapter-populated-record-array.js:11
Extends: DS.RecordArray
Defined in: addon/-private/system/record-arrays/adapter-populated-record-array.js:11
Module: ember-data
Represents an ordered list of records whose order and membership is
determined by the adapter. For example, a query sent to the adapter
may trigger a search on the server, whose results would be loaded
into an instance of the AdapterPopulatedRecordArray
.
Methods
Properties
_unregisterFromManager
private
addInternalModel
(internalModel, an)
private
Adds an internal model to the RecordArray
without duplicates
Parameters:
- internalModel InternalModel
- an Number
- optional index to insert at
loadRecords
(records, payload)
private
Parameters:
- records Array
- payload Object
- normalized payload
objectAtContent
(index)
DS.Model
private
Retrieves an object from the content by index.
Parameters:
- index Number
Returns:
- DS.Model
- record
removeInternalModel
(internalModel)
private
Removes an internalModel to the RecordArray
.
Parameters:
- internalModel InternalModel
save
DS.PromiseArray
Saves all of the records in the RecordArray
.
Example
1 2 3 4 5 |
var messages = store.peekAll('message'); messages.forEach(function(message) { message.set('hasBeenSeen', true); }); messages.save(); |
Returns:
- DS.PromiseArray
- promise
update
Used to get the latest version of all of the records in this array from the adapter.
Example
1 2 3 4 5 6 7 8 |
var people = store.peekAll('person'); people.get('isUpdating'); // false people.update().then(function() { people.get('isUpdating'); // false }); people.get('isUpdating'); // true |
content
Ember.Array
private
The array of client ids backing the record array. When a record is requested from the record array, the record for the client id at the same index is materialized, if necessary, by the store.
isLoaded
Boolean
The flag to signal a RecordArray
is finished loading data.
Example
1 2 |
var people = store.peekAll('person'); people.get('isLoaded'); // true |
isUpdating
Boolean
The flag to signal a RecordArray
is currently loading data.
Example
1 2 3 4 |
var people = store.peekAll('person'); people.get('isUpdating'); // false people.update(); people.get('isUpdating'); // true |