From b91992187d732c07854fd185e201eff84125a636 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 10:24:29 +0000 Subject: Updated Kohana to r3845 --- kohana/libraries/ORM.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'kohana/libraries/ORM.php') 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) { -- cgit v1.2.3