ZF-1156: Table_Row should be able to store dependent/parent rowsets
I think that a great improvement for table relationship would be to store and be able to access to the dependent rows within parent row object.
with the example of the manual we could have :
$tableAccount = new Accounts(); $anAccount = $tableAcount->find(1)->current();
and have in the Zend_Db_Table_Row object a detection of accessor like following that would fetch and store the dependent rows on the first call (and maybe also with a refresh method) :
same idea with parent rows :
in a second time we could imagine to be able to update dependent rows not only for primary key changes if using the where clause generated from the referenceMap (already implemented in the findDependantRowset). For example we would be able to add a dependent row for a parent row object :
$newBug = $tableBugs->fetchNew(); $newBug->bug_description = 'a description'; $newBug->bug_status = 'OPEN'; ... $aProduct->dependentBugs->add($newBug);
This last call could set the product_id value in $newBug if Zend_Db_Table_Rowset had stored the where clause used to fetch it (so with primary key value of the parent row)
Then ``` would add the new bug for this product;
I'm aware that it implies quite major modifications but I think this is really a must have functionality.