Class: DB_Table
Source Location: /DB_Table-0.17/DB/Table.php
DB_Table is a database API and data type SQL abstraction class.
Author(s):
Version:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
DB_Table (Constructor) [line 478]
object DB_Table DB_Table(
object
&$db, string
$table, [mixed
$create = false])
|
|
Constructor. If there is an error on instantiation, $this->error will be populated with the PEAR_Error.
Parameters:
addFormElements [line 1665]
void addFormElements(
object
&$form, [array
$columns = null], [string
$array_name = null])
|
|
Adds elements and rules to a pre-existing HTML_QuickForm object.
Parameters:
autoValidInsert [line 971]
void autoValidInsert(
[bool
$flag = true])
|
|
Turn on (or off) automatic validation of inserted data.
Parameters:
autoValidUpdate [line 1093]
void autoValidUpdate(
[bool
$flag = true])
|
|
Turn on (or off) automatic validation of updated data.
Parameters:
buildSQL [line 842]
mixed buildSQL(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Build the SQL command from a specified $this->sql element.
Parameters:
create [line 1436]
mixed create(
mixed
$flag)
|
|
Create the table based on $this->col and $this->idx.
Parameters:
delete [line 1178]
mixed delete(
string
$where)
|
|
Delete table rows matching a custom WHERE clause.
Parameters:
getBlankRow [line 1243]
Return a blank row array based on the column map. The array keys are the column names, and all values are set to null.
getColumns [line 551]
mixed getColumns(
[mixed
$col = null])
|
|
Returns all or part of the $this->col property array.
Parameters:
getForm [line 1633]
object HTML_QuickForm &getForm(
[array
$columns = null], [string
$array_name = null], [array
$args = array()])
|
|
Create and return a QuickForm object based on table columns.
Parameters:
getFormElement [line 1725]
object HTML_QuickForm_Element &getFormElement(
string
$column, string
$elemname)
|
|
Creates and returns a single QuickForm element based on a DB_Table column name.
Parameters:
getFormGroup [line 1697]
array &getFormGroup(
[array
$columns = null], [string
$array_name = null])
|
|
Creates and returns an array of QuickForm elements based on an array of DB_Table column names.
Parameters:
getIndexes [line 601]
array getIndexes(
[mixed
$idx = null], string
$col)
|
|
Returns all or part of the $this->idx property array.
Parameters:
insert [line 944]
mixed insert(
array
$data)
|
|
Insert a single table row after validating through validInsert().
Parameters:
isRequired [line 1580]
boolean isRequired(
mixed
$column)
|
|
Is a specific column required to be set and non-null?
Parameters:
isValid [line 1497]
boolean isValid(
array
$val, array
$col)
|
|
Check if a value validates against the DB_Table data type for a given column. This only checks that it matches the data type; it does not do extended validation.
Parameters:
nextID [line 1198]
integer nextID(
[string
$seq_name = null])
|
|
Generate a sequence value; sequence name defaults to the table name.
Parameters:
quote [line 1224]
string quote(
mixed
$val)
|
|
Escape and enquote a value for use in an SQL query. Helps makes user input safe against SQL injection attack.
recast [line 1280]
void recast(
array
&$data)
|
|
Force array elements to the proper types for their columns. This will not valiate the data, and will forcibly change the data to match the recast-type. The date, time, and timestamp recasting has special logic for arrays coming from an HTML_QuickForm object so that the arrays are converted into properly-formatted strings.
Parameters:
select [line 675]
mixed select(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Select rows from the table using one of the 'DB::get*()' methods.
Parameters:
selectResult [line 738]
mixed selectResult(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Select rows from the table as a DB_Result object.
Parameters:
supported [line 527]
bool supported(
string
$phptype)
|
|
Is a particular RDBMS supported by DB_Table?
Parameters:
throwError [line 440]
object PEAR_Error &throwError(
string
$code, [string
$extra = null])
|
|
Specialized version of throwError() modeled on PEAR_Error. Throws a PEAR_Error with a DB_Table error message based on a DB_Table constant error code.
Parameters:
update [line 1066]
mixed update(
array
$data, string
$where)
|
|
Update table row(s) matching a custom WHERE clause, after checking against validUpdate().
Parameters:
validInsert [line 1001]
mixed validInsert(
array
&$data)
|
|
Validate an array for insertion into the table.
Parameters:
validUpdate [line 1123]
mixed validUpdate(
array
&$data)
|
|
Validate an array for updating the table.
Parameters:
_getFormColDefs [line 1749]
array _getFormColDefs(
[string|array
$column_set = null])
|
|
Creates a column definition array suitable for DB_Table_QuickForm.
Parameters:
Documentation generated on Sun, 16 May 2004 05:22:03 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|