Xataface 2.0
Xataface Application Framework
Public Member Functions | Data Fields
Dataface_TreeTable Class Reference

Public Member Functions

 Dataface_TreeTable (&$record, $relationship=null)
getRecordByRowId ($rowid)
getSubrows (&$rows, $rowid, &$record, $depth=3)
 getSubrowsAsHTML ($rowid, $depth=3, $treetableid='treetable')
 toHtml ($depth=3, $treetableid='treetable')

Data Fields

 $record
 $relationship

Detailed Description

A tree table for displaying records in a heirarchical view.

Author:
Steve Hannah <shannah@sfu.ca> July 18, 2006

Definition at line 9 of file TreeTable.php.


Member Function Documentation

Dataface_TreeTable ( &$  record,
relationship = null 
)

Constructor.

Parameters:
Dataface_Record$recordThe root record.
string$relationshipThe name of the relationship.

Definition at line 28 of file TreeTable.php.

& getRecordByRowId ( rowid)

Returns the Dataface_Record object that belongs at the given row id.

Parameters:
string$rowidA hyphenated string that uniquely identifies a row of the tree table. e.g. 1-3-2 identifies the 2nd subrow of the 3rd subrow of the 1st row.
Returns:
Dataface_Record.

Definition at line 40 of file TreeTable.php.

& getSubrows ( &$  rows,
rowid,
&$  record,
depth = 3 
)

Returns the subrows of the given row as an array with keys being the rowid and values being Dataface_Record objects.

Parameters:
string$rowidThe row id of the root row. This will be a string such as '1-2-4'. In this example the root would be the 4th subrow of the 2nd subrow of the first row of the tree-table.
integer$depthHow deep down the tree heirarchy do we want to go.
Returns:
array An array of Dataface_Record objects that are subrows of the given row.

Definition at line 86 of file TreeTable.php.

getSubrowsAsHTML ( rowid,
depth = 3,
treetableid = 'treetable' 
)

Returns the subrows rooted at $rowid (not including $rowid's row) as html <tr> tags.

Parameters:
string$rowidThe id of the row whose subrowse we wish to retrieve.
integer$depthHow far down the tree do we want to go.
Returns:
string HTML for the subrows.

Definition at line 132 of file TreeTable.php.

toHtml ( depth = 3,
treetableid = 'treetable' 
)

Renders the entire treetable as HTML.

Definition at line 217 of file TreeTable.php.


Field Documentation

$record

Definition at line 14 of file TreeTable.php.

$relationship

Definition at line 20 of file TreeTable.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations