$_columns = array()
[line 158]
Columns' fields names and labels
Drivers can read the content of this property but must not change it.
$_columnsNum =
[line 204]
Number of columns
Drivers can read the content of this property but must not change it.
$_currentSort = array()
[line 184]
Fields/directions the data is currently sorted by
Drivers can read the content of this property but must not change it.
$_defaultDirections = array()
[line 306]
The default directions to sort by
Drivers can read the content of this property but must not change it.
$_features = array()
[line 326]
Special driver features
$_firstRecord =
[line 234]
First record number (starting from 1), in the current page
Drivers can read the content of this property but must not change it.
$_lastRecord =
[line 244]
Last record number (starting from 1), in the current page
Drivers can read the content of this property but must not change it.
$_multiSort = false
[line 194]
Whether the backend support sorting by multiple fields
Drivers can read the content of this property but must not change it.
$_options = array()
[line 318]
Common and driver-specific options
Drivers can read the content of this property but must not change it.
$_page = 1
[line 256]
Current page
Page number starting from 1.
Drivers can read the content of this property but must not change it.
$_pageLimit = null
[line 266]
Number of records per page
Drivers can read the content of this property but must not change it.
$_pagesNum =
[line 276]
Number of pages
Drivers can read the content of this property but must not change it.
$_records = array()
[line 174]
Records content
Drivers can read the content of this property but must not change it.
$_recordsNum = 0
[line 214]
Number of records in the current page
Drivers can read the content of this property but must not change it.
$_requestPrefix = ''
[line 286]
GET/POST/Cookie parameters prefix
Drivers can read the content of this property but must not change it.
$_sortableFields = array()
[line 296]
Which fields the datagrid may be sorted by
Drivers can read the content of this property but must not change it.
$_totalRecordsNum =
[line 224]
Total number of records as reported by the datasource
Drivers can read the content of this property but must not change it.
$_urlMapper = null
[line 371]
URL mapper instance, if provided
Structures_DataGrid_Renderer (Constructor) [line 381]
Structures_DataGrid_Renderer Structures_DataGrid_Renderer(
)
|
|
Instantiate the driver and set default options and features
Drivers may overload this method in order to change/add default options.
build [line 792]
void build(
array
$chunk, integer
$startRow, [boolean
$eof = false])
|
|
Build the grid
Drivers must not overload this method. Pre and post-build operations can be performed in init() and finalize()
Parameters:
buildBody [line 657]
Build the body
Drivers may overload() this method, if buildRow() and buildEmptyRow() are not flexible enough.
buildEmptyRow [line 707]
void buildEmptyRow(
int
$index)
|
|
Build an empty row
Drivers must overload this method if they need to do something with empty rows that remain at the end of the body.
This method will only be called if the "fillWithEmptyRows" option is enabled.
Parameters:
buildFooter [line 720]
Build the footer
Drivers may optionally implement this method.
buildHeader [line 615]
void buildHeader(
array
$columns)
|
|
Build the header
Drivers may optionally implement this method.
Parameters:
buildRow [line 689]
void buildRow(
int
$index, array
$data)
|
|
Build a body row
This is a very simple method for drivers to build a row. For more flexibility, drivers should overload buildBody()
Parameters:
defaultCellFormatter [line 775]
string defaultCellFormatter(
string
$value)
|
|
Default formatter for all cells
Drivers may optionally implement this method.
Parameters:
finalize [line 734]
Finish building the datagrid.
Drivers may optionally implement this method for any post-build() operations.
flatten [line 760]
Retrieve output from the container object
Drivers may optionally implement this method.
This method is meant to retrieve final output from the container.
Usually the container is an object (ex: HTMLTable instance), and the final output a string.
The driver knows how to retrieve such final output from a given container (ex: HTMLTable::toHTML()), and this is where to do it.
Sometimes the container may not be an object, but the final output itself. In this case, this method should simply return the container.
This method mustn't output anything directly to the standard output.
getContainer [line 579]
object Container getContainer(
)
|
|
Return the container used by the driver
Drivers should implement this method when they have some kind of support for rendering containers.
getFeatures [line 1188]
List special driver features
getOutput [line 919]
Returns the output from the renderer (e.g. HTML table, XLS object, ...)
Drivers must not overload this method. Output generation has to be implemented in flatten().
getUrlMapper [line 1223]
object Net_URL_Mapper getUrlMapper(
)
|
|
Return the URL mapper
hasFeature [line 1200]
bool hasFeature(
string
$name)
|
|
Tell if the driver as a specific feature
Parameters:
init [line 598]
Create or/and prepare the container
Drivers may optionally implement this method for any pre-build() operations.
For the container support, it is responsible for creating the container if it has not already been provided by the user with the setContainer() method. It is where preliminary container setup should also be done.
isBuilt [line 1045]
Query the grid build status
render [line 942]
Render to the standard output
This method may be overloaded by renderer drivers in order to prepare writing to the standard output (like calling header(), etc...).
setColumns [line 484]
void setColumns(
array
$columns)
|
|
Provide columns
This method is supposed to be called ONLY by the code that loads the driver. In most cases, that'll be the Structures_DataGrid class.
Parameters:
setContainer [line 563]
mixed setContainer(
object Container
$container)
|
|
Attach a container object
Drivers that provide support for the Structures_DataGrid::fill() method must implement this method.
Parameters:
setCurrentSorting [line 506]
void setCurrentSorting(
array
$currentSort, [bool
$multiSortCapable = false])
|
|
Specify how the datagrid is currently sorted
This method is supposed to be called ONLY by the code that loads the driver. In most cases, that'll be the Structures_DataGrid class.
The multiSort capabilities is related to the multiSort DataSource feature. In short : the DataGrid checks if the DataSource supports multiSort and informs the Renderer about it.
Parameters:
setLimit [line 523]
void setLimit(
int
$currentPage, int
$rowsPerPage, int
$totalRowNum)
|
|
Specify page and row limits
This method is supposed to be called ONLY by the code that loads the driver. In most cases, that'll be the Structures_DataGrid class.
Parameters:
setOption [line 470]
void setOption(
string
$name, mixed
$value)
|
|
Set a single option
Parameters:
setOptions [line 458]
void setOptions(
mixed
$options)
|
|
Set multiple options
Parameters:
setRendered [line 990]
void setRendered(
[bool
$status = false])
|
|
Sets the rendered status. This can be used to "flush the cache" in case you need to render the datagrid twice with the second time having changes
This is quite an obsolete method...
Parameters:
setRequestPrefix [line 1005]
void setRequestPrefix(
string
$prefix)
|
|
Set the HTTP Request prefix
Parameters:
setStreaming [line 548]
void setStreaming(
int
$status)
|
|
Tell the renderer whether streaming is enabled or not
This method is supposed to be called ONLY by the code that loads the driver. In most cases, that'll be the Structures_DataGrid class.
Parameters:
setUrlMapper [line 1212]
void setUrlMapper(
object
$instance)
|
|
Set the URL mapper
Parameters:
streamBody [line 628]
void streamBody(
array
$records, integer
$startRow, [boolean
$eof = false])
|
|
Stream a chunk of records
Parameters:
_addDefaultOptions [line 430]
void _addDefaultOptions(
array
$options)
|
|
Adds some default options.
This method is meant to be called by drivers. It allows adding some default options.
Parameters:
_buildOnMoveCall [line 1161]
string _buildOnMoveCall(
string
$page, mixed
$sortSpec)
|
|
Build a Javascript handler call for a given page and sorting spec
Parameters:
_buildSortingHttpQuery [line 1069]
string _buildSortingHttpQuery(
string
$field, string
$direction, [bool
$convertAmpersand = false], [array
$extraParameters = array()])
|
|
Build an HTTP query for sorting a given column
This is a handy method that most drivers can use in order to build the HTTP queries that are used to sort columns.
It takes the global "extraVars", "excludeVars" options as well as the $_requestPrefix property into account and can also convert the ampersand to XML/HTML entities according to the "encoding" option.
Parameters:
_noSupport [line 974]
object PEAR_Error _noSupport(
string
$method)
|
|
Return an error related to an unsupported public method
When a given public method is not implemented/supported by the driver it must return a PEAR_Error object with code DATAGRID_ERROR_UNSUPPORTED. This is a helper method for generating such PEAR_Error objects.
Example:
function anUnsupportedMethod()
{
}
Parameters:
_setFeatures [line 446]
void _setFeatures(
array
$features)
|
|
Add special driver features
This method is meant to be called by drivers. It allows specifying the special features that are supported by the current driver.
Parameters: