summaryrefslogtreecommitdiff
path: root/kohana/libraries/ORM.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/libraries/ORM.php')
-rw-r--r--kohana/libraries/ORM.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/kohana/libraries/ORM.php b/kohana/libraries/ORM.php
index 7fe126c9..99a8dc4f 100644
--- a/kohana/libraries/ORM.php
+++ b/kohana/libraries/ORM.php
@@ -1408,6 +1408,9 @@ class ORM_Core {
*/
protected function load_relations($table, ORM $model)
{
+ // Save the current query chain (otherwise the next call will clash)
+ $this->db->push();
+
$query = $this->db
->select($model->foreign_key(NULL).' AS id')
->from($table)
@@ -1415,6 +1418,8 @@ class ORM_Core {
->get()
->result(TRUE);
+ $this->db->pop();
+
$relations = array();
foreach ($query as $row)
{