Datagrid and linking dataobjects
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Thu, 20 Jan 2005 14:09:16 +0000 |
| Subject: | Datagrid and linking dataobjects | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17034@lists.php.net to get a copy of this message | ||
Hi,
Is it possible to link two dataobjects with a simple link (one to one
table link, not cross link tables or others) and bind the result on a
datagrid ?
I've tried the getlinks and joinadd methods but no results.
Example :
/**********************************************/
$obj = new DataObject_X;
//not necessary
$obj->find();
//option 1
$obj->getLinks();
//option 2
/*$obj->selectAs();
$obj2 = new DataObject_Y;
$obj->joinAdd($obj2);
$obj->selectAs($obj2,'Y_%s');*/
$dg =& new Structures_DataGrid(15);
$dg->bind($obj);
/********************************************************/
then I add columns with dg and render it as usual, names of columns
depending on the method used before.
JP. Dumont