[Solar-svn] Revision 2945
pmjones at solarphp.com
pmjones at solarphp.com
Wed Nov 14 16:28:33 CST 2007
Solar_Sql_Model: [CHG] Methods _fetchAll() and _fetchAssoc(), when doing has-many eager fetching, now use the SELECT statement instead of the selection params when calling fetchRelatedArray(). This should make it possible to fetch related records when the original SELECT statement uses WHERE conditions on joined tables.
Modified: trunk/Solar/Sql/Model.php
===================================================================
--- trunk/Solar/Sql/Model.php 2007-11-14 22:26:35 UTC (rev 2944)
+++ trunk/Solar/Sql/Model.php 2007-11-14 22:28:33 UTC (rev 2945)
@@ -581,6 +581,8 @@
*
* @return mixed
*
+ * @todo Expand to cover assoc, col, pairs, and value.
+ *
*/
public function __call($method, $params)
{
@@ -730,7 +732,7 @@
foreach ((array) $params['eager'] as $name) {
$related = $this->getRelated($name);
if ($related->type == 'has_many') {
- $data = $this->fetchRelatedArray($params, $name);
+ $data = $this->fetchRelatedArray($select, $name);
$coll->loadRelated($name, $data);
}
}
@@ -821,7 +823,7 @@
foreach ((array) $params['eager'] as $name) {
$related = $this->getRelated($name);
if ($related->type == 'has_many') {
- $data = $this->fetchRelatedArray($params, $name);
+ $data = $this->fetchRelatedArray($select, $name);
$coll->loadRelated($name, $data);
}
}
More information about the Solar-svn
mailing list