Class PEARSQLDataListSource

Description

This SQLDataListSource child class interacts with with the specific DB via the php PEAR DB abstraction objects.

How to use? in the DataList child's get_data_source() method you pass in the already connected PEAR DB object in to the constructor. PEARSQLDataListSource takes care of the rest.

Located in /widgets/data_list/PEARSQLDataListSource.inc (line 40)

DataListSource
   |
   --SQLDataListSource
      |
      --PEARSQLDataListSource
Variable Summary
mixed $_db
mixed $_result
Method Summary
PEARSQLDataListSource PEARSQLDataListSource (PEAR::DB &$db)
string build_limit_clause ( $offset,  $limit)
int count ( $tables, [string $where_clause = ''], [ $count_clause = '*'], string $table)
boolean do_query ()
array() get_next_data_row ()
void set_db_object ( &$db, object - $db)
Variables
mixed $_db = NULL (line 50)

This var holds the Database object

that is used to do the sql queries It is assumed that the db is already connected to, and the object provides 2 methods: query() - execute a sql query

mixed $_result = NULL (line 57)

this holds the query result from the

PEAR::DB->query() call

Inherited Variables

Inherited from SQLDataListSource

SQLDataListSource::$_db_options
SQLDataListSource::$_default_order_sensitivity
SQLDataListSource::$_query
SQLDataListSource::$_simple_search_case_insensitive

Inherited from DataListSource

DataListSource::$_columns
DataListSource::$_data
DataListSource::$_data_index
DataListSource::$_debug
DataListSource::$_query_params
Methods
Constructor PEARSQLDataListSource (line 67)

The constructor is used to pass in the PEAR DB object that has already been created and connected to the db.

PEARSQLDataListSource PEARSQLDataListSource (PEAR::DB &$db)
  • PEAR::DB &$db: object - MUST BE CONNECTED
build_limit_clause (line 122)

This function builds the limit clause portion of a DB query.

  • return: - the limit portion of the query.
string build_limit_clause ( $offset,  $limit)
  • $offset
  • $limit

Redefinition of:
SQLDataListSource::build_limit_clause()
This function builds the limit clause portion of a DB query.
count (line 153)

find the number of rows to be returned from a query from a table and where clause

  • return: the # of rows
int count ( $tables, [string $where_clause = ''], [ $count_clause = '*'], string $table)
  • string $table: - the table to count from
  • string $where_clause: - a where clause
  • $tables
  • $count_clause

Redefinition of:
SQLDataListSource::count()
find the number of rows to be returned from a query from a table and where clause
do_query (line 91)

This is the function that does the data fetching, and sorting if needed.

If the source is a sql database, this is where the query gets called. This function doesn't actually read the data from the DB yet. That is what get_next_data_row() does.

  • return: - the query passed/failed.
boolean do_query ()

Redefinition of:
SQLDataListSource::do_query()
Do the query to the DB and pull in all of the records locally.
get_next_data_row (line 111)

This function gets the next data row from the query()

array() get_next_data_row ()

Redefinition of:
SQLDataListSource::get_next_data_row()
This function gets the next data row from the query()
set_db_object (line 77)

Set the DB object we will use to talk to the DB.

void set_db_object ( &$db, object - $db)
  • object - $db: the babw_db object.
  • &$db

Inherited Methods

Inherited From SQLDataListSource

SQLDataListSource::advanced_search_where_clause()
SQLDataListSource::build_groupby_clause()
SQLDataListSource::build_limit_clause()
SQLDataListSource::build_order_clause()
SQLDataListSource::build_query()
SQLDataListSource::build_search_clause()
SQLDataListSource::build_where_clause()
SQLDataListSource::count()
SQLDataListSource::do_prequery()
SQLDataListSource::do_query()
SQLDataListSource::get_count_column()
SQLDataListSource::get_db_tables()
SQLDataListSource::get_db_values()
SQLDataListSource::get_default_order_case_sensitive()
SQLDataListSource::get_next_data_row()
SQLDataListSource::get_simple_search_case_insensitive()
SQLDataListSource::join_clauses()
SQLDataListSource::search_value_filter()
SQLDataListSource::setup_db_options()
SQLDataListSource::setup_order()
SQLDataListSource::set_count_column()
SQLDataListSource::set_db_groupby_clause()
SQLDataListSource::set_db_tables()
SQLDataListSource::set_db_values()
SQLDataListSource::set_db_where_clause()
SQLDataListSource::set_default_order_case_sensitive()
SQLDataListSource::set_simple_search_case_insensitive()
SQLDataListSource::simple_search_where_clause()
SQLDataListSource::sql_varchar_filter()

Inherited From DataListSource

DataListSource::DataListSource()
DataListSource::add_column()
DataListSource::do_prequery()
DataListSource::do_query()
DataListSource::get_data_index()
DataListSource::get_limit()
DataListSource::get_next_data_row()
DataListSource::get_offset()
DataListSource::get_orderby()
DataListSource::get_reverseorder()
DataListSource::get_searchby()
DataListSource::get_searchby_value()
DataListSource::get_search_type()
DataListSource::get_secondary_orderby()
DataListSource::get_simplesearch_modifier()
DataListSource::get_total_rows()
DataListSource::query()
DataListSource::row_filter()
DataListSource::set_debug()
DataListSource::set_limit()
DataListSource::set_offset()
DataListSource::set_orderby()
DataListSource::set_reverseorder()
DataListSource::set_searchby()
DataListSource::set_searchby_value()
DataListSource::set_search_type()
DataListSource::set_secondary_orderby()
DataListSource::set_simplesearch_modifier()
DataListSource::set_total_rows()
DataListSource::sort()
DataListSource::_is_column_sortable()

Documentation generated on Fri, 28 Jan 2011 08:53:11 -0500 by phpDocumentor 1.4.3