Structures_DataGrid_DataSource_DBTable

Structures_DataGrid_DataSource_DBTable -- PEAR::DB_Table Data Source Driver

Description

This class is a data source driver for the PEAR::DB_Table object

Supported operations modes

This driver supports the following operation modes:

Таблица 57-1. Supported operations modes of this driver

ModeSupported?
Multiple field sortingyes
Insert, update and delete recordsyes

Options

This driver accepts the following options:

Таблица 57-2. Options for this driver

OptionTypeDescriptionDefault Value
fieldsarrayWhich data fields to fetch from the datasource. An empty array means: all fields. Form: array(field1, field2, ...)array()
generate_columnsboolGenerate Structures_DataGrid_Column objects with labels. See the 'labels' option. DEPRECATED: use Structures_DataGrid::generateColumns() insteadfalse
labelsarrayData field to column label mapping. Only used when 'generate_columns' is true. Form: array(field => label, ...) DEPRECATED: use Structures_DataGrid::generateColumns() insteadarray()
paramsarrayPlaceholder parameters for prepare/executearray()
primary_keyarrayName(s), or numerical index(es) of the field(s) which contain a unique record identifier (only use several fields in case of a multiple-fields primary key)null
viewstringThe view from $sql array in your DB_Table object. This option is required.null
wherestringA where clause for the SQL query.null

General notes

If you use aliases in the select part of your view, the count() method from DB_Table and, therefore, $datagrid->getRecordCount() might return a wrong result. To avoid this, DB_Table uses a special query for counting if it is given via a view that needs to be named as '__count_' followed by the name of the view that this counting view belongs to. (For example: if you have a view named 'all', the counting view needs to be named as '__count_all'.)

To use update() and delete() methods, it is required that the indexes are properly defined in the $idx array in your DB_Table subclass. If you have, for example, created your database table yourself and did not setup the $idx array, you can use the 'primary_key' option to define the primary key field.


HIVE: All information for read only. Please respect copyright!
Hosted by hive ÊÃÁ: Êèåâñêàÿ ãîðîäñêàÿ áèáëèîòåêà