summaryrefslogtreecommitdiff
path: root/core/libraries/ORM_MPTT.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/libraries/ORM_MPTT.php')
-rw-r--r--core/libraries/ORM_MPTT.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php
index d7e8d7b7..2cdc617d 100644
--- a/core/libraries/ORM_MPTT.php
+++ b/core/libraries/ORM_MPTT.php
@@ -73,6 +73,14 @@ class ORM_MPTT_Core extends ORM {
}
/**
+ * Deleted this node and adjust the left and right pointers
+ */
+ public function delete() {
+ parent::delete();
+ $this->_grow(-1);
+ }
+
+ /**
* Return the parent of this node
*
* @return ORM
@@ -194,7 +202,7 @@ class ORM_MPTT_Core extends ORM {
*
* @param integer $count the number of new nodes to add
*/
- private function _grow($count=1) {
+ public function _grow($count=1) {
$size = $count * 2;
$this->db->query(
"UPDATE `{$this->table_name}` SET `left` = `left` + $size WHERE `left` >= {$this->right}");