From bf7ab8904aa9ccbb201b1ef9634a8b13834e5f6d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 7 Dec 2008 08:46:44 +0000 Subject: Change ORM_MPTT::add_to_parent() to take an ORM instead of an id so that it's consistent with ORM_MPTT::move_to() --- core/libraries/ORM_MPTT.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/libraries') diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php index c7cc5978..61c67b99 100644 --- a/core/libraries/ORM_MPTT.php +++ b/core/libraries/ORM_MPTT.php @@ -52,12 +52,11 @@ class ORM_MPTT_Core extends ORM { * @param integer $parent_id the id of the parent node * @return ORM */ - function add_to_parent($parent_id) { + function add_to_parent($parent) { $this->lock(); try { // Make a hole in the parent for this new item - $parent = ORM::factory($this->model_name, $parent_id); $this->db->query( "UPDATE `{$this->table_name}` SET `left` = `left` + 2 WHERE `left` >= {$parent->right}"); $this->db->query( -- cgit v1.2.3