Class DBHelper

Description

Utility class for anyDB

This class provides methods to display db results and functions for common sql queries.

Don't instanciate this class.
Use 'DBHelper::methodName()' instead.

Located in /core/anyDB/addon/DBHelper.php (line 26)

UtilityClass
   |
   --DBHelper
Method Summary
void checkBoxes (mixed $array, [mixed $name = ''], [mixed $selected = null], [mixed $additional = ''])
Mixed cloneDataset (mixed &$db, String $table, String $id_col, String $id, [Array $exclusion = null])
String dumpAll (Array $array, [Boolean $addHeader = true], [Boolean $headerArray = null], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
String dumpColumn (Array $array, [Boolean $horizontal = true], [Boolean $headerTitle = ''], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
String dumpNext (Array $array, [Boolean $addHeader = false], [Boolean $singleRow = true], [mixed $headerTitle = ''], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
Integer getCount (AbstractDB &$db, String $tableName)
String getMax (AbstractDB &$db, String $tableName, String $columnName)
String getMin (AbstractDB &$db, String $tableName, String $columnName)
void radioButtons (mixed $array, [mixed $name = ''], mixed $selected, [mixed $additional = ''])
String selectBox (Array $array, [mixed $name = ''], Integer $selected, [Integer $size = 1], [Boolean $multiple = false], [String $additional = ''])
Methods
checkBoxes (line 246)
void checkBoxes (mixed $array, [mixed $name = ''], [mixed $selected = null], [mixed $additional = ''])
cloneDataset (line 74)

Returns the resulting table but uses the $key field as an index

  • return: new key or FALSE
  • access: public
  • abstract:
Mixed cloneDataset (mixed &$db, String $table, String $id_col, String $id, [Array $exclusion = null])
  • String $table: the table name
  • String $id_col: the name of the primary key column
  • String $id: the key of the dataset to clone
  • Array $exclusion: columns not to copy
dumpAll (line 110)

Returns a html table for a 2-dimensional result set

  • return: html source
  • access: public
String dumpAll (Array $array, [Boolean $addHeader = true], [Boolean $headerArray = null], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
  • Array $array: the result set
  • Boolean $addHeader: show the array keys as header
  • Boolean $headerArray: alternative headers
dumpColumn (line 147)

Returns a html table for a result column

  • return: html source
  • access: public
String dumpColumn (Array $array, [Boolean $horizontal = true], [Boolean $headerTitle = ''], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
  • Array $array: the result set
  • Boolean $horizontal: order the table horizontally?
  • Boolean $headerTitle: alternative header?
dumpNext (line 181)

Returns a html table for a result row

  • return: html source
  • access: public
String dumpNext (Array $array, [Boolean $addHeader = false], [Boolean $singleRow = true], [mixed $headerTitle = ''], [mixed $tableTag = 'border="1"'], [mixed $trTag = ''], [mixed $tdTag = ''], [mixed $thTag = ''])
  • Array $array: the result set
  • Boolean $addHeader: display keys as header?
  • Boolean $singleRow: append table open and close tags?
getCount (line 348)

Returns the number of elements in a column

  • return: value
  • access: public
Integer getCount (AbstractDB &$db, String $tableName)
  • AbstractDB $db: db resource
  • String $tableName: table
getMax (line 331)

Returns the max value for a given table column

  • return: value
  • access: public
String getMax (AbstractDB &$db, String $tableName, String $columnName)
  • AbstractDB $db: db resource
  • String $tableName: table
  • String $columnName: column
getMin (line 312)

Returns the min value for a given table column

  • return: value
  • access: public
String getMin (AbstractDB &$db, String $tableName, String $columnName)
  • AbstractDB $db: db resource
  • String $tableName: table
  • String $columnName: column
radioButtons (line 277)
void radioButtons (mixed $array, [mixed $name = ''], mixed $selected, [mixed $additional = ''])
selectBox (line 217)

Returns a html selectBox for a result column

  • return: html source
  • access: public
String selectBox (Array $array, [mixed $name = ''], Integer $selected, [Integer $size = 1], [Boolean $multiple = false], [String $additional = ''])
  • Array $array: the result set
  • Integer $selected: the preselected value
  • Integer $size: number of elements shown
  • Boolean $multiple: multiple select?
  • String $additional: additional html code for the select tag

Inherited Methods

Inherited From UtilityClass

UtilityClass::UtilityClass()

Documentation generated on Tue, 4 Oct 2005 21:59:06 -0700 by phpDocumentor 1.3.0RC3