This is the base class for managing data for the DataList class. This abstracts away the underlying data layer from the DataList, so the data can come from multiple sources.
Most of the time the data will come from a data base such as Mysql or Oracle. This abstraction enables the data to also come from a tab delimited file, xml, php array
Located in Program_Root/widgets/data_list/DataListSource.inc (line 31)
Class | Description |
---|---|
SQLDataListSource | |
CSVFILEDataListSource | This DataListSource child class gets the data from a CSV (comma seperated values) file on disk. |
ArrayDataListSource | This DataListSource child class gets the data from an external array |
The column descriptions for the data we are working on
A placeholder for data that is read/built and stored locally. Not all data sources have to use this.
Each entry in the array corresponds to 1 row of data.
Holds the index into the array of data
so we can keep track of where we are when we are walking the array (only usefull for non DB children)
This is the message displayed when no data
was retrieved from the database
This holds various parameters relating
to the query of the data
The constructor
Add a column of data to manage
- the title of the column
- the data value name
- is the column sortable? default: FALSE
- is the column searchable default: FALSE
- the sort order (ASC, DESC) default: ASC
This is a method that should be defined by the child class to do any pre-query type of things.
Such as building a sql query string for a DB, or checking to make sure the file on disk exists if the source is a file on disk.
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.
This function returns the data_index value and increments it
This function gets the current value of the limit value
This function gets the next data row from the query()
This function is used to get the message displayed when no data is found
This function returns the value of the offset
This function returns the value of the orderby
This function returns the value of the reverseorder
This function returns the value of the searchby
This function returns the value of the search value
this function returns the current search type for the DataList query
This function returns the value of the search value
This returns the total number of rows in our entire data set
The main Query function.
This function is responsible for doing any data prefetching from a db,file and doing any sorting and searching on it depending on the values passed in from the DataList object
- the offset into the data set
- the # of rows to get
- the column to order the data by
- order in asc or reverse?
- the column in the dataset to search by
- the value to look for
- the simple search modifier.
This is called by the DataList object to allow us a chance to run the next row through a filter
- the row to run through the filter
This function is used to set
the limit value, which limits the # of rows of data to allow to return
This function is used to set the message displayed when no data is found
This sets the offset value and resets the index into the data array (in non DB children)
offset
This sets the orderby column name.
This corresponds to the column that wants to be sorted/ordered, but not the actual direction (asc, desc)
offset
This sets the flag that tells us the direction in which to order the orderby column.
offset
This sets the column that we want to search from.
offset
This sets the data that we want to search for.
offset
This function sets the search type (simple or advanced)
This sets the simple search modifier
offset
This is used to set the total # of rows we have in our data set
A generic method API that can be used at the bottom half of the do_query() method to sort data that is stored locally. This is only needed when the source is a non database.
It should operate on the $this->_data array
This function determines if the column associated w/ a data_name is sortable or not
- the data_name filed in the _columns array to look for
Documention generated on Thu, 31 Jul 2003 18:32:23 -0700 by phpDocumentor 1.2.0