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


Method: widgetFactor

(internal, and probably needs rewriting :)

Method: makeName


Method: build

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

Method: execInsert


Method: execUpdate


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


Method: display

Takes no parameters

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

Cell Attributes

This is a very incomplete list, it's basically here to document interesting attributes, feel free to add to me!

| name | value | description | dao_modified | boolean | If this row is modified, ignore it for the purposes of figuring out if this row should be inserted.

Input devices

Input types, and their associated properties


PEAR DataBase instance
table name
field to get the value from table
field to display from table