Zend Framework

Table_Row should be able to store dependent/parent rowsets

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: N/A N/A
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: Next Major Release
  • Component/s: Zend_Db_Table
  • Labels:
    None

Description

Hi,

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) :

$anAccount->dependentBugsViaReporter

same idea with parent rows :

$aBug->parentProduct

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

$aProduct->save();

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.

Wandrille

Activity

Hide
Bill Karwin added a comment -

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.

Show
Bill Karwin added a comment - 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.
Hide
Wil Sinclair added a comment -

Please categorize/fix as needed.

Show
Wil Sinclair added a comment - Please categorize/fix as needed.
Hide
Wil Sinclair added a comment -

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

Show
Wil Sinclair added a comment - Reassigning to Ralph since he's the new maintainer of Zend_Db

People

Vote (8)
Watch (8)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
3w
Original Estimate - 3 weeks
Remaining:
3w
Remaining Estimate - 3 weeks
Logged:
Not Specified
Time Spent - Not Specified