Zend Framework

Zend_Db_Table should allow for concrete instantiation

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Db_Table
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

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:

$categoryTable = new Zend_Db_Table(array(
                                       'db'      => 'db',
                                       'name'    => 'category',
                                       'primary' => 'id'));

It seems like a mistake.

Issue Links

Activity

Hide
Matthew Turland added a comment -

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.

Show
Matthew Turland added a comment - 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.
Hide
Moxley Stratton added a comment -

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.

Show
Moxley Stratton added a comment - 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.
Hide
Ryan Mauger added a comment -

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

Show
Ryan Mauger added a comment - The class also has @depreciated version 0.9 for some reason, should it be there?
Hide
Ralph Schindler added a comment -

Changed title

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

Show
Ralph Schindler added a comment - Changed title this would also require some better loadClass() handling inside row and rowset.
Hide
Ralph Schindler added a comment -

Fixed for ZF 1.9 as of r16802

Show
Ralph Schindler added a comment - Fixed for ZF 1.9 as of r16802

People

Vote (5)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: