[Solar-svn] Revision 2733

pmjones at solarphp.com pmjones at solarphp.com
Fri Aug 24 08:36:39 CDT 2007


Branch: Solar_Sql_Model: [FIX] Method newRelatedSelect() now joins properly to the native table under has-many-through


Modified: branches/orm/Solar/Sql/Model.php
===================================================================
--- branches/orm/Solar/Sql/Model.php	2007-08-23 01:33:41 UTC (rev 2732)
+++ branches/orm/Solar/Sql/Model.php	2007-08-24 13:36:39 UTC (rev 2733)
@@ -1316,10 +1316,10 @@
                 $select->where(
                     "{$opts['through_alias']}.{$opts['through_native_col']} IN ($inner)"
                 );
-                // add the native table ID at the top
+                // add the native table ID at the top through a join
                 $select->leftJoin(
                     "{$this->_table_name} AS {$this->_model_name}",
-                    "{$opts['foreign_alias']}.{$opts['foreign_col']} = {$this->_model_name}.{$opts['native_col']}",
+                    "{$opts['through_alias']}.{$opts['through_native_col']} = {$this->_model_name}.{$opts['native_col']}",
                     "{$opts['native_col']} AS {$this->_model_name}__{$opts['native_col']}"
                 );
             }




More information about the Solar-svn mailing list