diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 08:46:44 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-07 08:46:44 +0000 |
commit | bf7ab8904aa9ccbb201b1ef9634a8b13834e5f6d (patch) | |
tree | d62ae674a2a81696420ef293b0a033605c84da02 /core/libraries/ORM_MPTT.php | |
parent | e40b54a4689f1565e0f76c536d0d4b05b23afc1e (diff) |
Change ORM_MPTT::add_to_parent() to take an ORM instead of an id so
that it's consistent with ORM_MPTT::move_to()
Diffstat (limited to 'core/libraries/ORM_MPTT.php')
-rw-r--r-- | core/libraries/ORM_MPTT.php | 3 |
1 files changed, 1 insertions, 2 deletions
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( |