Issues

ZF-1549: Add 'init' hook to Zend_Db_Table, Rowset and Row

Issue Type: New Feature Created: 2007-06-11T19:40:18.000+0000 Last Updated: 2008-03-21T16:25:27.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Simon Mundy (peptolab) Assignee: Simon Mundy (peptolab) Tags: - Zend_Db_Table

Related issues: Attachments:

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.

Comments

Posted by Bill Karwin (bkarwin) on 2007-06-12T17:58:05.000+0000

Assign to me.

Categorize as Zend_Db_Table.

Posted by Craig Slusher (sleek) on 2007-07-26T18:45:51.000+0000

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.

Posted by Bill Karwin (bkarwin) on 2007-07-26T19:47:31.000+0000

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

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

Posted by Darby Felton (darby) on 2007-10-31T11:58:34.000+0000

Assigning to [~peptolab] to be resolved with the approved Zend_Db_Table enhancements proposal.

Posted by Simon Mundy (peptolab) on 2008-01-18T21:28:09.000+0000

Resolved in r7508

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts