Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: g:\Work\WWW\php\tbox\lib/cdbtabform.phps
PHP Documentation - PHP/Toolbox::Form

CDBTabForm

CSnippet
  |
  +-- CForm
    |
    +-- CDBForm
      |
      +-- CDBQueryForm
        |
        +-- CDBTabForm

Uses "show fields from table" statement

 

private class CDBTabForm extends CDBQueryForm

Uses "show fields from table" statement
to generate a form for given table. | $form = new CDBQueryForm(FORM_HTML_HANDLER, | "table_1", | $PHP_SELF, "get" | ); | $form->build(array( | "field_1" => new CControl(array( | ... | )), | ... | )); | ... | $form->render();

See AlsoaddControls(), get_infield()

 

Methods inherited from CDBQueryForm

cdbqueryform, process_specially

Methods inherited from CDBForm

addcontrols, get_infield, setup_infield, set_lookup_options

Methods inherited from CForm

cform, addcontrols, addcontrol, addvars, addsubmitcancel, setmode, getvalue, invalue, outvalue, outvalues, validatevalues, validatevalue, render, renderstart, renderend, rendercontrol, renderstartcontrol, renderendcontrol, write

Methods inherited from CSnippet

csnippet, append, qualify, getglobal, setglobal, write, flush, writecode

Public Method Summary

void

CDBTabForm( $handler, string $table, string $action, string $method, string $attrs)

Constructs the form.

Private Method Summary

void

build([ array $FIELD_DESCR ])

Builds the control listNo additional comments.
void

fetchValues(string $where)

Fetches controls' values from the query.No additional comments.
void

setList(string $table)

Constructs the SQL 'set' clause list with the fields thatNo additional comments.

Fields inherited from CDBQueryForm

$sql

Fields inherited from CForm

$mode, $action, $method, $controls

Fields inherited from CSnippet

$id

Private Field Summary

integer

$groupSizeThreshold

If the group items count exceeds this value
integer

$groupLenThreshold

If summary group items length exceeds this value
unknown

$table

Public Method Details

CDBTabForm

public void CDBTabForm( $handler, string $table, string $action, string $method, string $attrs )

  Constructs the form.
The call format is similar to base class.

Parameter
$handler
No additional comments.
string $table
No additional comments.
string $action
No additional comments.
string $method
No additional comments.
string $attrs
No additional comments.
Returns void


Private Method Details

build

private void build( [ array $FIELD_DESCR ] )

  Builds the control list
using the form sql-query meta-info.

No additional comments.

Parameter
array $FIELD_DESCR = >>array()<<
Returns void


fetchValues

private void fetchValues( string $where )

  Fetches controls' values from the query.
It performs some std processing, like converting csv-lists into arrays and uses control's inValue() to possibly customize the value processing as well.

No additional comments.

Parameter
string $where
- fetching use its own where clause that is simply appended to form sql-string: "$this->sql $this->where $where"
Returns void

See Also CDBQueryForm()

setList

private void setList( string $table )

  Constructs the SQL 'set' clause list with the fields that
belong to specified table, e.g.: | do_query("insert into table_1 set ".setList("table_1");

No additional comments.

Parameter
string $table
No additional comments.
Returns void


Private Field Details

$groupSizeThreshold

private integer $groupSizeThreshold

>>4<<

If the group items count exceeds this value
then CSelect is used, otherwise -- CGroup.


$groupLenThreshold

private integer $groupLenThreshold

>>40<<

If summary group items length exceeds this value
then CSelect is used, otherwise -- CGroup.


$table

private unknown $table

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta