 
     syncOptions.data.search = @loadOptions.search if @loadOptions.search
     syncOptions
+
+####################################
 
 class Brainstem.DataLoader
   constructor: (options = {}) ->

      @storageManager.getCollectionDetails(@loadOptions.name).cache[@loadOptions.cacheKey] = results

    if @loadOptions.only?
      @_success @loadOptions, @collection, _.map(@loadOptions.only, (id) => @cachedCollection.get(id))
    else
      @_success @loadOptions, @collection, _(results).map (result) -> base.data.storage(result.key).get(result.id)

  _buildSyncOptions: ->
    syncOptions =


  _loadCollectionWithFirstLayer: (options) =>
    cl = new Brainstem.CollectionLoader(storageManager: @storageManager, successFunction: @_success)
    cl.loadCollection(options)

  _handleNextLayer: (options) =>
    # Collection is a fully populated collection of tasks whose first layer of associations are loaded.
