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 Program_Root/widgets/data_list/PEARSQLDataListSource.inc (line 40)

DataListSource
   |
   --SQLDataListSource
      |
      --PEARSQLDataListSource
Variable Summary
mixed $_db
mixed $_result
Method Summary
void PEARSQLDataListSource (PEAR::DB &$db)
string build_limit_clause (mixed $offset, mixed $limit)
int count (mixed $tables, [string $where_clause = ''], [mixed $count_clause = '*'], string $table)
boolean do_query ()
array() get_next_data_row ()
void set_db_object (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::$_query

Inherited from DataListSource

DataListSource::$_columns
DataListSource::$_data
DataListSource::$_data_index
DataListSource::$_not_found_message
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.

void PEARSQLDataListSource (PEAR::DB &$db)
  • PEAR::DB &$db:

    object - MUST BE CONNECTED

build_limit_clause (line 121)

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

  • return:

    - the limit portion of the query.

string build_limit_clause (mixed $offset, mixed $limit)

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

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

  • return:

    the # of rows

int count (mixed $tables, [string $where_clause = ''], [mixed $count_clause = '*'], string $table)
  • string $table:

    - the table to count from

  • string $where_clause:

    - a where 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 110)

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 (object - &$db)
  • object - $db:

    the babw_db object.

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_next_data_row()
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::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_not_found_message()
DataListSource::get_offset()
DataListSource::get_orderby()
DataListSource::get_reverseorder()
DataListSource::get_searchby()
DataListSource::get_searchby_value()
DataListSource::get_search_type()
DataListSource::get_simplesearch_modifier()
DataListSource::get_total_rows()
DataListSource::query()
DataListSource::row_filter()
DataListSource::set_limit()
DataListSource::set_not_found_message()
DataListSource::set_offset()
DataListSource::set_orderby()
DataListSource::set_reverseorder()
DataListSource::set_searchby()
DataListSource::set_searchby_value()
DataListSource::set_search_type()
DataListSource::set_simplesearch_modifier()
DataListSource::set_total_rows()
DataListSource::sort()
DataListSource::_is_column_sortable()

Documention generated on Thu, 31 Jul 2003 18:32:56 -0700 by phpDocumentor 1.2.0