Class: DB_Table
Source Location: /DB_Table-1.4.0/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 707]
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 2465]
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:
addStaticFormElements [line 2494]
void addStaticFormElements(
object
&$form)
|
|
Adds static form elements like 'header', 'static', 'submit' or 'reset' to a pre-existing HTML_QuickForm object. The form elements needs to be defined in a property called $frm.
Parameters:
alter [line 2212]
Alters the table based on $this->col and $this->idx.
autoRecast [line 1887]
void autoRecast(
[bool
$flag = true])
|
|
Turns on (or off) automatic recasting of insert and update data.
Parameters:
autoValidInsert [line 1551]
void autoValidInsert(
[bool
$flag = true])
|
|
Turns on (or off) automatic validation of inserted data.
Parameters:
autoValidUpdate [line 1685]
void autoValidUpdate(
[bool
$flag = true])
|
|
Turns on (or off) automatic validation of updated data.
Parameters:
buildSQL [line 1403]
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 2148]
mixed create(
mixed
$flag)
|
|
Creates the table based on $this->col and $this->idx.
Parameters:
delete [line 1770]
mixed delete(
string
$where)
|
|
Deletes table rows matching a custom WHERE clause.
Parameters:
getBlankRow [line 1860]
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 946]
mixed getColumns(
[mixed
$col = null])
|
|
Returns all or part of the $this->col property array.
Parameters:
getForm [line 2430]
object HTML_QuickForm &getForm(
[array
$columns = null], [string
$array_name = null], [array
$args = array()], [string
$clientValidate = null], [array
$formFilters = null])
|
|
Creates and returns a QuickForm object based on table columns.
Parameters:
getFormElement [line 2553]
object HTML_QuickForm_Element &getFormElement(
string
$column, string
$elemname)
|
|
Creates and returns a single QuickForm element based on a DB_Table column name.
Parameters:
getFormElements [line 2584]
object HTML_QuickForm_Element &getFormElements(
array
$cols, [string
$array_name = null])
|
|
Creates and returns an array of QuickForm elements based on a DB_Table column name.
Parameters:
getFormGroup [line 2524]
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 996]
array getIndexes(
[
$idx = null], string
$col)
|
|
Returns all or part of the $this->idx property array.
Parameters:
getPHPTypeAndDBSyntax [line 888]
array getPHPTypeAndDBSyntax(
object
&$db)
|
|
Detect values of 'phptype' and 'dbsyntax' keys of DSN.
Parameters:
insert [line 1514]
mixed insert(
array
$data)
|
|
Inserts a single table row after validating through validInsert().
Parameters:
isRequired [line 2369]
boolean isRequired(
mixed
$column)
|
|
Is a specific column required to be set and non-null?
Parameters:
isValid [line 2281]
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:
modeSupported [line 839]
bool|object True modeSupported(
string
$mode, string
$phptype)
|
|
Is a creation mode supported for a RDBMS by DB_Table?
Parameters:
nextID [line 1797]
integer nextID(
[string
$seq_name = null])
|
|
Generates a sequence value; sequence name defaults to the table name.
Parameters:
quote [line 1836]
Escapes and enquotes a value for use in an SQL query. Helps makes user input safe against SQL injection attack.
Parameters:
recast [line 1920]
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 1083]
mixed select(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null], [array
$params = array()])
|
|
Selects rows from the table using one of the DB/MDB2 get*() methods.
Parameters:
selectCount [line 1279]
mixed selectCount(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null], [array
$params = array()])
|
|
Counts the number of rows which will be returned by a query. This function works identically to select(), but it returns the number of rows returned by a query instead of the query results themselves. This makes using DB_Table with Pager easier, since you can pass the return value of this to Pager as totalItems, then select only the rows you need to display on a page.
Parameters:
selectResult [line 1186]
mixed selectResult(
string
$sqlkey, [string
$filter = null], [string
$order = null], [int
$start = null], [int
$count = null], [array
$params = array()])
|
|
Selects rows from the table as a DB_Result/MDB2_Result_* object.
Parameters:
setErrorMessage [line 919]
void setErrorMessage(
mixed
$code, [string
$message = null])
|
|
Overwrite one or more error messages, e.g. to internationalize them.
Parameters:
supported [line 813]
bool supported(
string
$phptype, [string
$dbsyntax = ''])
|
|
Is a particular RDBMS supported by DB_Table?
Parameters:
throwError [line 662]
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 1646]
mixed update(
array
$data, string
$where)
|
|
Updates table row(s) matching a custom WHERE clause, after checking against validUpdate().
Parameters:
validInsert [line 1579]
mixed validInsert(
&$data, array
$data)
|
|
Validates an array for insertion into the table.
Parameters:
validUpdate [line 1713]
mixed validUpdate(
&$data, array
$data)
|
|
Validates an array for updating the table.
Parameters:
verify [line 2253]
Verifies the table based on $this->col and $this->idx.
_getFormColDefs [line 2608]
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 14:48:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|