PhpExt : Data [ class tree ] [ index ] [ all elements ]

Class: PhpExt_Data_Store

Source Location: /PhpExt/Data/Store.php

Class PhpExt_Data_Store

Class Overview

The Store class encapsulates a client side cache of Record objects which provide input data for Components such as the GridPanel, the ComboBox, or the DataView

A Store object uses its configured implementation of DataProxy to access a data object unless you call loadData directly and pass in your data.

A Store object has no knowledge of the format of the data returned by the Proxy.

A Store object uses its configured implementation of DataReader to create Record instances from the data object. These Records are cached and made available through accessor functions.

Located in /PhpExt/Data/Store.php [line 30]

PhpExt_Object
   |
   --PhpExt_Observable
      |
      --PhpExt_Data_Store
Author(s):
API Tags:
Usedby:  PhpExt_Toolbar_PagingToolbar::getStore()
Usedby:  PhpExt_Toolbar_PagingToolbar::setStore()

Methods

[ Top ]
Descendants
Child Class Description
PhpExt_Data_GroupingStore A specialized store implementation that provides for grouping records by one of the available fields.
PhpExt_Data_JsonStore Small helper class to make creating Stores for JSON data easier.
PhpExt_Data_SimpleStore Small helper class to make creating Stores from Array data easier.

[ Top ]
Method Summary
PhpExt_Data_Store   __construct()  
boolean   getAutoLoad()   If passed, this store's load method is automatically called after creation with the autoLoad object
array   getBaseParams()   An object containing properties which are to be sent as parameters on any HTTP request
mixed   getData()   Inline data to be loaded when the store is initialized.
PhpExt_Data_DataProxy   getProxy()   The Proxy object which provides access to a data object.
boolean   getPruneModifiedRecords()   True to clear all modified record information each time the store is loaded or when a record is removed. (defaults to false).
PhpExt_Data_DataReader   getReader()   The Reader object which processes the data object and returns an Array of Ext.data.record objects which are cached keyed by their id property.
boolean   getRemoteSort()   True if sorting is to be handled by requesting the Proxy to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).
PhpExt_Data_SortInfoConfigObject   getSortInfo()   SortInfo Configuration Object
string   getStoreId()   If passed, the id to use to register with the StoreMgr
string   getUrl()   If passed, an HttpProxy is created for the passed URL
void   load()   Loads the Record cache from the configured Proxy using the configured Reader.
void   loadData()   Loads data from a passed data block. A Reader which understands the format of the data must have been configured in the constructor.
PhpExt_Data_Store   setAutoLoad()   If passed, this store's load method is automatically called after creation with the autoLoad object
PhpExt_Data_Store   setBaseParams()   An array containing properties which are to be sent as parameters on any HTTP request.
PhpExt_Data_Store   setData()   Inline data to be loaded when the store is initialized.
PhpExt_Data_Store   setProxy()   The Proxy object which provides access to a data object.
PhpExt_Data_Store   setPruneModifiedRecords()   True to clear all modified record information each time the store is loaded or when a record is removed. (defaults to false).
PhpExt_Data_Store   setReader()   The Reader object which processes the data object and returns an Array of Ext.data.record objects which are cached keyed by their id property.
PhpExt_Data_Store   setRemoteSort()   True if sorting is to be handled by requesting the Proxy to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).
PhpExt_Data_Store   setSortInfo()   SortInfo Configuration Object
PhpExt_Data_Store   setStoreId()   If passed, the id to use to register with the StoreMgr
PhpExt_Data_Store   setUrl()   If passed, an HttpProxy is created for the passed URL

[ Top ]
Methods
Constructor __construct  [line 249]

  PhpExt_Data_Store __construct( )


API Tags:
Access:  public


Redefinition of:
PhpExt_Observable::__construct()

Redefined in descendants as:

[ Top ]
getAutoLoad  [line 46]

  boolean getAutoLoad( )

If passed, this store's load method is automatically called after creation with the autoLoad object


API Tags:
Access:  public


[ Top ]
getBaseParams  [line 68]

  array getBaseParams( )

An object containing properties which are to be sent as parameters on any HTTP request

Format:

  1. array('param1'=>10,'param2'=>'some value')


API Tags:
Access:  public


[ Top ]
getData  [line 86]

  mixed getData( )

Inline data to be loaded when the store is initialized.


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
getProxy  [line 113]

  PhpExt_Data_DataProxy getProxy( )

The Proxy object which provides access to a data object.


API Tags:
See:  PhpExt_Data_ScriptTagProxy
See:  PhpExt_Data_DataProxy
See:  PhpExt_Data_MemoryProxy
See:  PhpExt_Data_HttpProxy
Access:  public


[ Top ]
getPruneModifiedRecords  [line 131]

  boolean getPruneModifiedRecords( )

True to clear all modified record information each time the store is loaded or when a record is removed. (defaults to false).


API Tags:
Access:  public


[ Top ]
getReader  [line 158]

  PhpExt_Data_DataReader getReader( )

The Reader object which processes the data object and returns an Array of Ext.data.record objects which are cached keyed by their id property.


API Tags:
See:  PhpExt_Data_XmlReader
See:  PhpExt_Data_DataReader
See:  PhpExt_Data_JsonReader
See:  PhpExt_Data_ArrayReader
Access:  public


[ Top ]
getRemoteSort  [line 188]

  boolean getRemoteSort( )

True if sorting is to be handled by requesting the Proxy to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).

If remote sorting is specified, then clicking on a column header causes the current page to be requested from the server with the addition of the following two parameters:

  • sort : String The name (as specified in the Record's Field definition) of the field to sort on.
  • dir : String The direction of the sort, "ASC" or "DESC".


API Tags:
Access:  public


[ Top ]
getSortInfo  [line 207]

SortInfo Configuration Object


API Tags:
Access:  public


[ Top ]
getStoreId  [line 225]

  string getStoreId( )

If passed, the id to use to register with the StoreMgr


API Tags:
Access:  public


[ Top ]
getUrl  [line 243]

  string getUrl( )

If passed, an HttpProxy is created for the passed URL


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
load  [line 275]

  void load( [PhpExt_Data_StoreLoadOptions $options = null]  )

Loads the Record cache from the configured Proxy using the configured Reader.

If using remote paging, then the first load call must specify the start and limit properties in the options.params property to establish the initial position within the dataset, and the number of Records to cache on each read from the Proxy.

It is important to note that for remote data sources, loading is asynchronous, and this call will return before the new data has been loaded. Perform any post-processing in a callback function, or in a "load" event handler.

Parameters:
PhpExt_Data_StoreLoadOptions   $options: 

API Tags:
Access:  public


[ Top ]
loadData  [line 286]

  void loadData( mixed $data, [boolean $append = false]  )

Loads data from a passed data block. A Reader which understands the format of the data must have been configured in the constructor.

Parameters:
mixed   $data:  The data block from which to read the Records. The format of the data expected is dependent on the type of Reader that is configured and should correspond to that Reader's readRecords parameter.
boolean   $append:  (Optional) True to append the new Records rather than replace the existing cache.

API Tags:
Access:  public


[ Top ]
setAutoLoad  [line 38]

  PhpExt_Data_Store setAutoLoad( boolean $value  )

If passed, this store's load method is automatically called after creation with the autoLoad object

Parameters:
boolean   $value: 

API Tags:
Access:  public


[ Top ]
setBaseParams  [line 58]

  PhpExt_Data_Store setBaseParams( array $value  )

An array containing properties which are to be sent as parameters on any HTTP request.

Format:

  1. array('param1'=>10,'param2'=>'some value')

Parameters:
array   $value: 

API Tags:
Access:  public


[ Top ]
setData  [line 78]

  PhpExt_Data_Store setData( mixed $value  )

Inline data to be loaded when the store is initialized.

Parameters:
mixed   $value: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
setProxy  [line 101]

  PhpExt_Data_Store setProxy( PhpExt_Data_DataProxy $value  )

The Proxy object which provides access to a data object.

Parameters:
PhpExt_Data_DataProxy   $value: 

API Tags:
See:  PhpExt_Data_ScriptTagProxy
See:  PhpExt_Data_DataProxy
See:  PhpExt_Data_MemoryProxy
See:  PhpExt_Data_HttpProxy
Access:  public
Uses:  PhpExt_Data_DataProxy


[ Top ]
setPruneModifiedRecords  [line 123]

  PhpExt_Data_Store setPruneModifiedRecords( boolean $value  )

True to clear all modified record information each time the store is loaded or when a record is removed. (defaults to false).

Parameters:
boolean   $value: 

API Tags:
Access:  public


[ Top ]
setReader  [line 146]

  PhpExt_Data_Store setReader( PhpExt_Data_DataReader $value  )

The Reader object which processes the data object and returns an Array of Ext.data.record objects which are cached keyed by their id property.

Parameters:
PhpExt_Data_DataReader   $value: 

API Tags:
See:  PhpExt_Data_XmlReader
See:  PhpExt_Data_DataReader
See:  PhpExt_Data_JsonReader
See:  PhpExt_Data_ArrayReader
Access:  public
Uses:  PhpExt_Data_DataReader


[ Top ]
setRemoteSort  [line 174]

  PhpExt_Data_Store setRemoteSort( boolean $value  )

True if sorting is to be handled by requesting the Proxy to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).

If remote sorting is specified, then clicking on a column header causes the current page to be requested from the server with the addition of the following two parameters:

  • sort : String The name (as specified in the Record's Field definition) of the field to sort on.
  • dir : String The direction of the sort, "ASC" or "DESC".

Parameters:
boolean   $value: 

API Tags:
Access:  public


[ Top ]
setSortInfo  [line 199]

SortInfo Configuration Object

Parameters:
PhpExt_Data_SortInfoConfigObject   $value: 

API Tags:
Access:  public
Uses:  PhpExt_Data_SortInfoConfigObject


[ Top ]
setStoreId  [line 217]

  PhpExt_Data_Store setStoreId( string $value  )

If passed, the id to use to register with the StoreMgr

Parameters:
string   $value: 

API Tags:
Access:  public


[ Top ]
setUrl  [line 235]

  PhpExt_Data_Store setUrl( string $value  )

If passed, an HttpProxy is created for the passed URL

Parameters:
string   $value: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]

Documentation generated on Fri, 08 Aug 2008 16:00:32 -0500 by phpDocumentor 1.4.0