ZF-3486: Zend_Db_Table should allow for concrete instantiation

Issue Type: Improvement Created: 2008-06-19T18:45:55.000+0000 Last Updated: 2009-07-31T20:32:50.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Moxley Stratton (moxley) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Table

Related issues: - ZF-3347



There is already a Zend_Db_Table_Abstract, and Zend_Db_Table is an empty class. If Zend_Db_Table was concrete, I could do this without any issues:

<pre class="highlight">
$categoryTable = new Zend_Db_Table(array(
                                       'db'      => 'db',
                                       'name'    => 'category',
                                       'primary' => 'id'));

It seems like a mistake.


Posted by Matthew Turland (elazar) on 2008-08-11T13:20:47.000+0000

I believe what is now Zend_Db_Table_Abstract used to be Zend_Db_Table. I think it was moved to make it consistent with naming conventions throughout the rest of the framework and that it was kept as an abstract class to maintain backward compatibility.

Posted by Moxley Stratton (moxley) on 2008-08-11T13:38:32.000+0000

Couple points for clarification:

  1. Turning an abstract into a concrete class shouldn't affect backward compatibility 2) An abstract Zend_Db_Table class is inconsistent with other similar classes in ZendFW where a class was split into an abstract and concrete. For example: Zend_Db_Table_Row_Abstract (abstract) and Zend_Db_Table_Row (concrete). Another example: Zend_Db_Table_Rowset_Abstract (abstract) and Zend_Db_Table_Rowset (concrete).

Someone probably forgot to remove the 'abstract' keyword from the Zend_Db_Table definition when it was split into two classes.

Posted by Ryan Mauger (bittarman) on 2008-12-03T13:08:43.000+0000

The class also has @depreciated version 0.9 for some reason, should it be there?

Posted by Ralph Schindler (ralph) on 2009-01-10T10:54:39.000+0000

Changed title

this would also require some better loadClass() handling inside row and rowset.

Posted by Ralph Schindler (ralph) on 2009-07-17T08:37:57.000+0000

Fixed for ZF 1.9 as of r16802

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.