ZF-1692: Allow extension of Zend_Db_Select join types

Issue Type: Improvement Created: 2007-07-09T14:56:16.000+0000 Last Updated: 2008-03-21T16:25:37.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Ralf Eggert (ralf) Assignee: Simon Mundy (peptolab) Tags: - Zend_Db_Select

Related issues: Attachments:


since I need to use the MySQL specific STRAIGHT_JOIN Syntax to optimize the run time for some queries, I had to extend Zend_Db_Select.

I created a Travello_Db_Select_Mysql class which extends the Zend_Db_Select class. Then I added a new constant STRAIGHT_JOIN and a new method joinStraight(). Until now everything is fine, but now I got two problems with the Zend_Db_Select::_join() method of Zend_Db_Select.

  1. The first row of the Zend_Db_Select::_join() method looks like this:
<pre class="highlight">
   $joinTypes = array(self::INNER_JOIN, self::LEFT_JOIN,
                      self::RIGHT_JOIN, self::FULL_JOIN,
                      self::CROSS_JOIN, self::NATURAL_JOIN);

To add my self::STRAIGHT_JOIN constant I need to copy the whole Zend_Db_Select::_join() method and the only thing I need to change is this first row.

  1. Since the method Zend_Db_Select::_uniqueCorrelation() is defined as private I get a fatal error. So I had to change Zend_Db_Select::_uniqueCorrelation() from private to protected.

Is there a chance that Zend_Db_Select could be changed a little to avoid these problems when extending Zend_Db_Select, i.e.

  1. Create an extensible method which creates the $joinTypes Array in the Zend_Db_Select::_join() method
  2. Change Zend_Db_Select::_uniqueCorrelation() from private to protected


Posted by Bill Karwin (bkarwin) on 2007-07-09T15:10:31.000+0000

Reformatted summary and description a little bit.

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

Resolved in r7508

Have you found an issue?

See the Overview section for more details.


© 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.