Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojo/store/Memory.js

  • Provides:

    • dojo.store.Memory
  • Requires:

    • dojo.store.util.QueryResults in common
    • dojo.store.util.SimpleQueryEngine in common
  • dojo.store.Memory

    • type
      Function
    • parameters:
      • options: (typeof dojo.store.Memory)
        This provides any configuration information that will be mixed into the store.
        This should generally include the data property to provide the starting set of data.
    • summary
      This is a basic in-memory object store. It implements dojo.store.api.Store.
  • dojo.store.Memory.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • options: (typeof dojo.store.Memory)
        This provides any configuration information that will be mixed into the store.
        This should generally include the data property to provide the starting set of data.
    • summary
      Creates a memory object store.
  • dojo.store.Memory.data

    • type
      Array
    • summary
      The array of all the objects in the memory store
  • dojo.store.Memory.idProperty

    • type
      String
    • summary
      Indicates the property to use as the identity property. The values of this
      property should be unique.
  • dojo.store.Memory.index

    • type
      Object
    • summary
      An index of data by id
  • dojo.store.Memory.queryEngine

    • alias - dojo.store.util.SimpleQueryEngine
    • type
      Function
    • summary
      Defines the query engine to use for querying the data store
  • dojo.store.Memory.get

    • parameters:
      • id: (typeof Number)
        The identity to use to lookup the object
    • summary
      Retrieves an object by its identity
    • return_summary
      Object
      The object in the store that matches the given id.
    • type
      Function
  • dojo.store.Memory.getIdentity

    • parameters:
      • object: (typeof Object)
        The object to get the identity from
    • summary
      Returns an object's identity
    • return_summary
      Number
    • type
      Function
  • dojo.store.Memory.put

    • parameters:
      • object: (typeof Object)
        The object to store.
      • options: (typeof dojo.store.api.Store.PutDirectives)
        Additional metadata for storing the data.  Includes an "id"
        property if a specific id is to be used.
    • summary
      Stores an object
    • return_summary
      Number
    • type
      Function
  • dojo.store.Memory.data.length

  • dojo.store.Memory.add

    • parameters:
      • object: (typeof Object)
        The object to store.
      • options: (typeof dojo.store.api.Store.PutDirectives)
        Additional metadata for storing the data.  Includes an "id"
        property if a specific id is to be used.
    • summary
      Creates an object, throws an error if the object already exists
    • return_summary
      Number
    • type
      Function
  • dojo.store.Memory.remove

    • parameters:
      • id: (typeof Number)
        The identity to use to delete the object
    • summary
      Deletes an object by its identity
    • type
      Function
  • dojo.store.Memory.query

    • parameters:
      • query: (typeof Object)
        The query to use for retrieving objects from the store.
      • options: (typeof dojo.store.api.Store.QueryOptions)
        The optional arguments to apply to the resultset.
    • summary
      Queries the store for objects.
    • return_summary
      dojo.store.api.Store.QueryResults
      The results of the query, extended with iterative methods.
    • example
      Given the following store:
      
      	var store = new dojo.store.Memory({
      		data: [
      			{id: 1, name: "one", prime: false },
      			{id: 2, name: "two", even: true, prime: true},
      			{id: 3, name: "three", prime: true},
      			{id: 4, name: "four", even: true, prime: false},
      			{id: 5, name: "five", prime: true}
      		]
      	});
      
      ...find all items where "prime" is true:
      
      	var results = store.query({ prime: true });
      
      ...or find all items where "even" is true:
      
      	var results = store.query({ even: true });
    • type
      Function
  • dojo.store.Memory.setData

    • parameters:
      • data: (typeof Object[])
        An array of objects to use as the source of data.
    • summary
      Sets the given data as the source for this store, and indexes it
    • type
      Function
  • dojo.store.Memory.setData.data

    • type
      Object[]
    • summary
      An array of objects to use as the source of data.
  • dojo.store

    • type
      Object
  • dojo

    • type
      Object