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

Class: Structures_DataGrid_DataSource_SQLQuery

Source Location: /Structures_DataGrid-0.9.3/Structures/DataGrid/DataSource.php

Class Overview

Structures_DataGrid_DataSource
   |
   --Structures_DataGrid_DataSource_SQLQuery

Base abstract class for SQL query based DataSource drivers


Author(s):

Version:

  • $Revision$

Variables

Methods


Inherited Variables

Inherited Methods

Class: Structures_DataGrid_DataSource

Structures_DataGrid_DataSource::Structures_DataGrid_DataSource()
Constructor
Structures_DataGrid_DataSource::bind()
Datasource binding method prototype
Structures_DataGrid_DataSource::count()
Counting method prototype
Structures_DataGrid_DataSource::delete()
Record deletion method prototype
Structures_DataGrid_DataSource::dump()
Dump the data as returned by fetch().
Structures_DataGrid_DataSource::fetch()
Fetching method prototype
Structures_DataGrid_DataSource::free()
Resources cleanup method prototype
Structures_DataGrid_DataSource::getColumns()
Generate columns if options are properly set
Structures_DataGrid_DataSource::getFeatures()
List special driver features
Structures_DataGrid_DataSource::getPrimaryKey()
Return the primary key specification
Structures_DataGrid_DataSource::hasFeature()
Tell if the driver as a specific feature
Structures_DataGrid_DataSource::insert()
Record insertion method prototype
Structures_DataGrid_DataSource::setOption()
Set a single option
Structures_DataGrid_DataSource::setOptions()
Set options
Structures_DataGrid_DataSource::sort()
Sorting method prototype
Structures_DataGrid_DataSource::update()
Record updating method prototype
Structures_DataGrid_DataSource::_addDefaultOptions()
Adds some default options.
Structures_DataGrid_DataSource::_setFeatures()
Add special driver features

Class Details

[line 484]
Base abstract class for SQL query based DataSource drivers

SUPPORTED OPTIONS:

  • db_options: (array) Options for the created database object. This option is only used when the 'dsn' option is given.
  • count_query: (string) Query that calculates the number of rows. See below for more information about when such a count query is needed.



[ Top ]


Class Variables

$_handle =

[line 506]

Instantiated database object
  • Access: protected

Type:   object


[ Top ]

$_query =

[line 492]

SQL query
  • Access: protected

Type:   string


[ Top ]

$_sortSpec =

[line 499]

Fields/directions to sort the data by
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 523]

Structures_DataGrid_DataSource_SQLQuery __construct( )

Constructor
  • Access: public

[ Top ]

bind   [line 543]

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

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

Overrides Structures_DataGrid_DataSource::bind() (Datasource binding method prototype)

Parameters:

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

[ Top ]

count   [line 649]

mixed count( )

Count
  • Return: The number or records (int), PEAR_Error on failure
  • Access: public

Overrides Structures_DataGrid_DataSource::count() (Counting method prototype)
[ Top ]

fetch   [line 586]

mixed fetch( [integer $offset = 0], [integer $limit = null])

Fetch
  • Return: The 2D Array of the records on success, PEAR_Error on failure
  • Access: public

Overrides Structures_DataGrid_DataSource::fetch() (Fetching method prototype)

Parameters:

integer   $offset     Offset (starting from 0)
integer   $limit     Limit

[ Top ]

free   [line 703]

void free( )

Disconnect from the database, if needed
  • Abstract:
  • Access: public

Overrides Structures_DataGrid_DataSource::free() (Resources cleanup method prototype)
[ Top ]

sort   [line 721]

void sort( mixed $sortSpec, [string $sortDir = 'ASC'])

This can only be called prior to the fetch method.
  • Access: public

Overrides Structures_DataGrid_DataSource::sort() (Sorting method prototype)

Parameters:

mixed   $sortSpec     A single field (string) to sort by, or a sort specification array of the form: array(field => direction, ...)
string   $sortDir     Sort direction: 'ASC' or 'DESC' This is ignored if $sortDesc is an array

[ Top ]


Documentation generated on Fri, 27 Jan 2012 13:30:07 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.