Structures_DataGrid_DataSource_MDB2
[ class tree: Structures_DataGrid_DataSource_MDB2 ] [ index: Structures_DataGrid_DataSource_MDB2 ] [ all elements ]

Class: Structures_DataGrid_DataSource_MDB2

Source Location: /Structures_DataGrid_DataSource_MDB2-0.1.11/DataGrid/DataSource/MDB2.php

Class Overview

Structures_DataGrid_DataSource_SQLQuery
   |
   --Structures_DataGrid_DataSource_MDB2

PEAR::MDB2 SQL Query Data Source Driver


Author(s):

Version:

  • $Revision: 1.37 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 90]
PEAR::MDB2 SQL Query Data Source Driver

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

SUPPORTED OPTIONS:

  • dbc: (object) A PEAR::MDB2 instance that will be used by this driver. Either this or the 'dsn' option is required.
  • dsn: (string) A PEAR::MDB2 dsn string. The MDB2 connection will be established by this driver. Either this or the 'dbc' option is required.
GENERAL NOTES:

You need to specify either a MDB2 instance or a MDB2 compatible dsn string as an option to use this driver.

If you use complex queries (e.g. with complex joins or with aliases), $datagrid->getRecordCount() might return a wrong result. For the case of GROUP BY, UNION, or DISTINCT in your queries, and for the case of subqueries, this driver already has special handling. However, if you observe wrong record counts, you need to specify a special query that returns only the number of records (e.g. 'SELECT COUNT(*) FROM ...') as an additional option 'count_query' to the bind() call.

You can specify an ORDER BY statement in your query. Please be aware that this sorting statement is then used in *every* query before the sorting options that come from a renderer (e.g. by clicking on the column header when using the HTML_Table renderer which is sent in the HTTP request). If you want to give a default sorting statement that is only used if there is no sorting query in the HTTP request, then use $datagrid->setDefaultSort().



[ Top ]


Method Detail

bind   [line 103]

mixed bind( string $query, [mixed $options = array()])

Bind
  • Return: True on success, PEAR_Error on failure
  • Access: public

Parameters:

string   $query     The query string
mixed   $options     array('dbc' => [connection object]) or array('dsn' => [dsn string])

[ Top ]

_connect   [line 118]

mixed &_connect( )

Connect to the database
  • Return: Instantiated databased object, PEAR_Error on failure
  • Access: protected

[ Top ]

_disconnect   [line 129]

void _disconnect( )

Disconnect from the database
  • Access: protected

[ Top ]

_getOne   [line 205]

mixed _getOne( string $query)

Fetches and returns a single value
  • Return: The fetched value, PEAR_Error on failure
  • Access: protected

Parameters:

string   $query     The query string

[ Top ]

_getRecords   [line 155]

mixed _getRecords( string $query, integer $limit, integer $offset)

Fetches and returns the records
  • Return: The fetched records, PEAR_Error on failure
  • Access: protected

Parameters:

string   $query     The (modified) query string
integer   $offset     Offset (starting from 0)
integer   $limit     Limit

[ Top ]

_getRecordsNum   [line 217]

mixed _getRecordsNum( string $query)

Calculates (and returns) the number of records by getting all records
  • Return: The numbers row records, PEAR_Error on failure
  • Access: protected

Parameters:

string   $query     The query string

[ Top ]

_isConnection   [line 141]

bool _isConnection( object $dbc)

Whether the parameter is a MDB2 object
  • Return: Whether the parameter is a MDB2 object
  • Access: protected

Parameters:

object   $dbc     MDB2 object

[ Top ]

_quoteIdentifier   [line 193]

string _quoteIdentifier( $field)

Returns a quoted identifier
  • Return: The quoted identifier
  • Access: protected

Parameters:

   $field     

[ Top ]


Documentation generated on Tue, 18 Dec 2007 11:30:26 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.