This driver accepts the following options:
Table 55-1. Options for this driver
Option | Type | Description | Default Value |
---|---|---|---|
fields | array | Which data fields to fetch from the datasource. An empty array means: all fields. Form: array(field1, field2, ...) | array() |
generate_columns | bool | Generate Structures_DataGrid_Column objects with labels. See the 'labels' option. | false |
labels | array | Data field to column label mapping. Only used when 'generate_columns' is true. Form: array(field => label, ...) | array() |
params | array | Placeholder parameters for prepare/execute | array() |
view | string | The view from $sql array in your DB_Table object. This option is required. | |
where | string | A where clause for the SQL query. | null |
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'.)