Penguin
Note: You are viewing an old revision of this page. View the current version.

Perry wrote a Data Aware Object library. It's vaguely incomplete and buggy. However it needs some documentation, and using the wiki appeared to be the best way to write documentation for it.

Object !DataSource?

Constructor: !DataSource?

Parameters: |Position|name|type|description | 1 | db | Pear::DB class | database to work on | 2 | table | string | name of the table to work on | 3 | description | ordered associative array | see below | 4 | prefs | order associative array | see below

Method: setInsert

|Position|name|type|description | 1 | has_insert | boolean (defaults to true)| if true, this has an insert row

Display the insert row

Method: setWhere

|Position|name|type|description | 1 | where | string | where clause to use to limit the display

Method: setFixed

|Position|name|type|description | 1 | column | string | column name | 2 | value | string | value the column must have

Method: addDetail

|Position|name|type|description | 1 | ourcolumn | string | the column in the master table | 2 | datasource | !DataSource? | the data source to act as the detail | 3 | theircolumn | string | the column in the detail table that joins to "ourcolumn" in the master table

Method: doSelect

(internal)

Method: widgetFactor

(internal, and probably needs rewriting :)

Method: makeName

(internal)

Method: build

Rebuild the table. Must be called before update for some reason.

Method: execInsert

(internal)

Method: execUpdate

(internal)

Method: update

Takes no parameters

Must have build() called first for some reason.

Returns an array of error strings of any problems found, or an empty array if no problems are found

Method: updateTrigger

Takes no parameters

Called on update, to be overridden.

Object: dao_table

Inherits from: !DataSource?

Creates a table out of a !DataSource?

Method: draw_cell

(internal)

Method: display

Takes no parameters

displays the table. Expects build() to be called first