version 4 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
PerryLorier |
1 |
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. |
|
|
2 |
|
|
|
3 |
!!!Object !DataSource |
|
|
4 |
|
|
|
5 |
!Constructor: !DataSource |
|
|
6 |
Parameters: |
2 |
PerryLorier |
7 |
|__Position__|__name__|__type__|__description__ |
1 |
PerryLorier |
8 |
| 1 | db | Pear::DB class | database to work on |
|
|
9 |
| 2 | table | string | name of the table to work on |
|
|
10 |
| 3 | description | ordered associative array | see below |
|
|
11 |
| 4 | prefs | order associative array | see below |
2 |
PerryLorier |
12 |
|
|
|
13 |
!Method: setInsert |
|
|
14 |
|__Position__|__name__|__type__|__description__ |
|
|
15 |
| 1 | has_insert | boolean ''(defaults to true)''| if true, this has an insert row |
|
|
16 |
|
|
|
17 |
Display the insert row |
|
|
18 |
|
|
|
19 |
!Method: setWhere |
|
|
20 |
|__Position__|__name__|__type__|__description__ |
|
|
21 |
| 1 | where | string | where clause to use to limit the display |
|
|
22 |
|
|
|
23 |
!Method: setFixed |
|
|
24 |
|__Position__|__name__|__type__|__description__ |
|
|
25 |
| 1 | column | string | column name |
|
|
26 |
| 2 | value | string | value the column must have |
|
|
27 |
|
|
|
28 |
!Method: addDetail |
|
|
29 |
|__Position__|__name__|__type__|__description__ |
|
|
30 |
| 1 | ourcolumn | string | the column in the master table |
|
|
31 |
| 2 | datasource | !DataSource | the data source to act as the detail |
|
|
32 |
| 3 | theircolumn | string | the column in the detail table that joins to "ourcolumn" in the master table |
|
|
33 |
|
|
|
34 |
!Method: doSelect |
|
|
35 |
''(internal)'' |
|
|
36 |
|
|
|
37 |
!Method: widgetFactor |
|
|
38 |
''(internal, and probably needs rewriting :)'' |
|
|
39 |
|
|
|
40 |
!Method: makeName |
|
|
41 |
''(internal)'' |
|
|
42 |
|
|
|
43 |
!Method: build |
|
|
44 |
Rebuild the table. Must be called before update for some reason. |
|
|
45 |
|
|
|
46 |
!Method: execInsert |
|
|
47 |
''(internal)'' |
|
|
48 |
|
|
|
49 |
!Method: execUpdate |
|
|
50 |
''(internal)'' |
|
|
51 |
|
|
|
52 |
!Method: update |
|
|
53 |
Takes no parameters |
|
|
54 |
|
|
|
55 |
Must have build() called first for some reason. |
|
|
56 |
|
|
|
57 |
Returns an array of error strings of any problems found, or an empty array if no problems are found |
|
|
58 |
|
|
|
59 |
!Method: updateTrigger |
|
|
60 |
Takes no parameters |
|
|
61 |
|
|
|
62 |
Called on update, to be overridden. |
|
|
63 |
|
|
|
64 |
!!!Object: dao_table |
|
|
65 |
__Inherits from__: !DataSource |
|
|
66 |
|
|
|
67 |
Creates a table out of a !DataSource |
|
|
68 |
|
|
|
69 |
!Method: draw_cell |
|
|
70 |
''(internal)'' |
|
|
71 |
|
|
|
72 |
!Method: display |
|
|
73 |
Takes no parameters |
|
|
74 |
|
|
|
75 |
displays the table. Expects build() to be called first |
3 |
PerryLorier |
76 |
|
|
|
77 |
!!Cell Attributes |
|
|
78 |
This is a very incomplete list, it's basically here to document interesting attributes, feel free to add to me! |
|
|
79 |
|
|
|
80 |
| __name__ | __value__ | __description__ |
|
|
81 |
| dao_modified | boolean | If this row is modified, ignore it for the purposes of figuring out if this row should be inserted. |
4 |
PerryLorier |
82 |
|
|
|
83 |
!!!Input devices |
|
|
84 |
Input types, and their associated properties |
|
|
85 |
!combo |
|
|
86 |
;db: PEAR DataBase instance |
|
|
87 |
;table: table name |
|
|
88 |
;joinfield: field to get the value from ''table'' |
|
|
89 |
;displayfield: field to display from ''table'' |