ZF-1156: Table_Row should be able to store dependent/parent rowsets

Issue Type: New Feature Created: 2007-03-29T02:10:02.000+0000 Last Updated: 2012-11-20T20:53:11.000+0000 Status: Closed Fix version(s): - Next Major Release ()

Reporter: Wandrille MOUSSEL (wmoussel) Assignee: None Tags: - Zend_Db_Table

Related issues: Attachments:



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 :

<pre class="highlight">
$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) :

<pre class="highlight">

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 :

<pre class="highlight">
$newBug = $tableBugs->fetchNew();
$newBug->bug_description = 'a description';
$newBug->bug_status = 'OPEN';

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.



Posted by Bill Karwin (bkarwin) on 2007-03-29T13:50:11.000+0000

This is a pretty fancy new feature. I have changed the issue type to 'new feature'.

This is part of being an object-relational mapping (ORM), and Zend_Db_Table has a long way to go to provide that functionality. The scope of work for Zend_Db_Table is to provide the Table Data Gateway and Row Data Gateway patterns, not a fully features ORM.

That would be a really great product, but we cannot do this in the short term with Zend_Db. I will leave the issue open though and perhaps someday we will do it.

Posted by Wil Sinclair (wil) on 2008-03-25T20:43:55.000+0000

Please categorize/fix as needed.

Posted by Wil Sinclair (wil) on 2008-12-04T13:17:30.000+0000

Reassigning to Ralph since he's the new maintainer of Zend_Db

Posted by Rob Allen (rob) on 2012-11-20T20:53:11.000+0000

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.