Class: DB_Table
Source Location: /DB_Table-0.21.2/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 500]
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 1724]
void addFormElements(
object
&$form, [array
$columns = null], [string
$array_name = null], [
$clientValidate = null])
|
|
Adds elements and rules to a pre-existing HTML_QuickForm object.
Parameters:
autoRecast [line 1302]
void autoRecast(
[bool
$flag = true])
|
|
Turns on (or off) automatic recasting of insert and update data.
Parameters:
autoValidInsert [line 998]
void autoValidInsert(
[bool
$flag = true])
|
|
Turns on (or off) automatic validation of inserted data.
Parameters:
autoValidUpdate [line 1125]
void autoValidUpdate(
[bool
$flag = true])
|
|
Turns on (or off) automatic validation of updated data.
Parameters:
buildSQL [line 864]
mixed buildSQL(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Builds the SQL command from a specified $this->sql element.
Parameters:
create [line 1493]
mixed create(
mixed
$flag)
|
|
Creates the table based on $this->col and $this->idx.
Parameters:
delete [line 1210]
mixed delete(
string
$where)
|
|
Deletes table rows matching a custom WHERE clause.
Parameters:
getBlankRow [line 1275]
Returns 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 573]
mixed getColumns(
[mixed
$col = null])
|
|
Returns all or part of the $this->col property array.
Parameters:
getForm [line 1690]
object HTML_QuickForm &getForm(
[array
$columns = null], [string
$array_name = null], [array
$args = array()], [
$clientValidate = null])
|
|
Creates and returns a QuickForm object based on table columns.
Parameters:
getFormElement [line 1786]
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 1758]
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 623]
array getIndexes(
[
$idx = null], string
$col)
|
|
Returns all or part of the $this->idx property array.
Parameters:
insert [line 966]
mixed insert(
array
$data)
|
|
Inserts a single table row after validating through validInsert().
Parameters:
isRequired [line 1637]
boolean isRequired(
mixed
$column)
|
|
Is a specific column required to be set and non-null?
Parameters:
isValid [line 1554]
boolean isValid(
array
$val, array
$col)
|
|
Checks 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 1230]
integer nextID(
[string
$seq_name = null])
|
|
Generates a sequence value; sequence name defaults to the table name.
Parameters:
quote [line 1256]
Escapes and enquotes a value for use in an SQL query. Helps makes user input safe against SQL injection attack.
Parameters:
recast [line 1337]
void recast(
array
&$data)
|
|
Forces 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 697]
mixed select(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Selects rows from the table using one of the 'DB::get*()' methods.
Parameters:
selectResult [line 760]
mixed selectResult(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null])
|
|
Selects rows from the table as a DB_Result object.
Parameters:
supported [line 549]
bool supported(
string
$phptype)
|
|
Is a particular RDBMS supported by DB_Table?
Parameters:
throwError [line 462]
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 1093]
mixed update(
array
$data, string
$where)
|
|
Updates table row(s) matching a custom WHERE clause, after checking against validUpdate().
Parameters:
validInsert [line 1028]
mixed validInsert(
&$data, array
$data)
|
|
Validates an array for insertion into the table.
Parameters:
validUpdate [line 1155]
mixed validUpdate(
&$data, array
$data)
|
|
Validates an array for updating the table.
Parameters:
_getFormColDefs [line 1810]
array _getFormColDefs(
[string|array
$column_set = null])
|
|
Creates a column definition array suitable for DB_Table_QuickForm.
Parameters:
Documentation generated on Mon, 11 Mar 2019 13:52:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|