Zend Framework

Add 'init' hook to Zend_Db_Table, Rowset and Row

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0.0 RC2
  • Fix Version/s: 1.5.0
  • Component/s: Zend_Db_Table
  • Labels:
    None

Description

It would be great to have an 'init' method to use for overridden objects so that the constructor doesn't need to be altered.

Activity

Hide
Bill Karwin added a comment -

Assign to me.

Categorize as Zend_Db_Table.

Show
Bill Karwin added a comment - Assign to me. Categorize as Zend_Db_Table.
Hide
Craig Slusher added a comment -

This would be a very simple addition to each of the classes, but what is an example use case for it? I can't think of any.

Show
Craig Slusher added a comment - This would be a very simple addition to each of the classes, but what is an example use case for it? I can't think of any.
Hide
Bill Karwin added a comment -

Having a clear use case is important, but as a side comment I want to point out that although one could write a solution as follows with no "hooks":

class MyTable extends Zend_Db_Table_Abstract
{
  public function __construct($options)
  {
    // pre-init code
    parent::__construct($options);
    // post-init code
  }
}

However, "Call Super" is considered an anti-pattern: http://en.wikipedia.org/wiki/Call_super

Show
Bill Karwin added a comment - Having a clear use case is important, but as a side comment I want to point out that although one could write a solution as follows with no "hooks":
class MyTable extends Zend_Db_Table_Abstract
{
  public function __construct($options)
  {
    // pre-init code
    parent::__construct($options);
    // post-init code
  }
}
However, "Call Super" is considered an anti-pattern: http://en.wikipedia.org/wiki/Call_super
Hide
Darby Felton added a comment -

Assigning to Simon Mundy to be resolved with the approved Zend_Db_Table enhancements proposal.

Show
Darby Felton added a comment - Assigning to Simon Mundy to be resolved with the approved Zend_Db_Table enhancements proposal.
Hide
Simon Mundy added a comment -

Resolved in r7508

Show
Simon Mundy added a comment - Resolved in r7508

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: