Protected properties available to drivers
All of the following properties are read-only :
drivers can access their content but must not change it directly.
array $_options -Common and driver-specific
options
array $_columns - Columns fields names and
labels
int $_columnsNum - Number of columns
array $_records - Records content
int $_recordsNum - Number of records
in the current page
int $_totalRecordsNum - Total number of
records as reported by the datasource
int $_firstRecord - First record number (starting from 1), in the current page
int $_lastRecord - Last record number (starting from 1), in the current page
int $_page - Current page number (starting
from 1)
int $_pageLimit - Number of records per page
int $_pagesNum - Number of pages
string $_requestPrefix - GET/POST/Cookie
parameters prefix
array $_currentSort - Fields/directions
the data is currently sorted by
array $_sortableFields - Which fields the
datagrid may be sorted by
Methods that must or may be implemented in drivers
All of the following methods are optional.
The constructor must set default options via
_addDefaultOptions(), if any, and call the parent
constructor.
setContainer() is responsible for attaching a rendering
container provided by the user. It must
return a
PEAR_Error object in case of failure.
getContainer() must return a reference to the
container used by the driver.
It must return a
PEAR_Error object in case of failure.
init() must initialize the rendering process.
This method is also responsible for creating the container if it has not
already been provided with
setContainer().
buildHeader() must build the header.
$columns is a convenient reference to the
$_columns property.
Protected methods that drivers can use
_addDefaultOptions() is used to declare the
driver-specific options, if any, as well as their default values.
It must be called from the constructor.
setOptions() is a public method used to set
options. If they ever need to change options, drivers should use this
method.