aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/tree
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-04-25 17:19:52 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-04-25 17:19:52 +0200
commit73d873548400f18b02167ef49195a50a11970c24 (patch)
tree063a52aad0a55e86fc2c2ad6aecae95450bf73ff /phpBB/includes/tree
parentd4b7708d4b1f6d83caae52794dc3f602b7fe96a1 (diff)
downloadforums-73d873548400f18b02167ef49195a50a11970c24.tar
forums-73d873548400f18b02167ef49195a50a11970c24.tar.gz
forums-73d873548400f18b02167ef49195a50a11970c24.tar.bz2
forums-73d873548400f18b02167ef49195a50a11970c24.tar.xz
forums-73d873548400f18b02167ef49195a50a11970c24.zip
[ticket/11495] Remove fixing function from tree interface
The fixing function is implementation dependent. PHPBB3-11495
Diffstat (limited to 'phpBB/includes/tree')
-rw-r--r--phpBB/includes/tree/interface.php34
-rw-r--r--phpBB/includes/tree/nestedset.php19
2 files changed, 24 insertions, 29 deletions
diff --git a/phpBB/includes/tree/interface.php b/phpBB/includes/tree/interface.php
index fd10bd357f..babd0ad03d 100644
--- a/phpBB/includes/tree/interface.php
+++ b/phpBB/includes/tree/interface.php
@@ -18,7 +18,7 @@ if (!defined('IN_PHPBB'))
interface phpbb_tree_interface
{
/**
- * Insert an item into the nested set (also insert the rows into the table)
+ * Insert an item into the tree (also insert the rows into the table)
*
* @param array $item The item to be added
* @return array Array with item data as set in the database
@@ -26,7 +26,7 @@ interface phpbb_tree_interface
public function insert(array $additional_data);
/**
- * Add an item at the end of the nested set
+ * Add an item at the end of the tree
*
* @param array $item The item to be added
* @return bool True if the item was added
@@ -34,9 +34,9 @@ interface phpbb_tree_interface
public function add(array $item);
/**
- * Remove an item from the nested set
+ * Remove an item from the tree
*
- * Also removes all subitems from the nested set
+ * Also removes all subitems from the tree
*
* @param int $item_id The item to be deleted
* @return array Item ids that have been removed
@@ -44,9 +44,9 @@ interface phpbb_tree_interface
public function remove($item);
/**
- * Delete an item from the nested set (also deletes the rows form the table)
+ * Delete an item from the tree
*
- * Also deletes all subitems from the nested set
+ * Also deletes all subitems from the tree
*
* @param int $item_id The item to be deleted
* @return array Item ids that have been deleted
@@ -146,26 +146,4 @@ interface phpbb_tree_interface
* ID => Item data
*/
public function get_parent_data(array $item);
-
- /**
- * Regenerate left/right ids from parent/child relationship
- *
- * This method regenerates the left/right ids for the nested set based on
- * the parent/child relations. This function executes three queries per
- * item, so it should only be called, when the set has one of the following
- * problems:
- * - The set has a duplicated value inside the left/right id chain
- * - The set has a missing value inside the left/right id chain
- * - The set has items that do not have a left/right is set
- *
- * When regenerating the items, the items are sorted by parent id and their
- * current left id, so the current child/parent relationships are kept
- * and running the function on a working set will not change any orders.
- *
- * @param int $new_id First left_id to be used (should start with 1)
- * @param int $parent_id parent_id of the current set (default = 0)
- * @param bool $reset_ids Should we reset all left_id/right_id on the first call?
- * @return int $new_id The next left_id/right_id that should be used
- */
- public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids = false);
}
diff --git a/phpBB/includes/tree/nestedset.php b/phpBB/includes/tree/nestedset.php
index 2110e1a6d2..72e3aa4d71 100644
--- a/phpBB/includes/tree/nestedset.php
+++ b/phpBB/includes/tree/nestedset.php
@@ -696,7 +696,24 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
}
/**
- * @inheritdoc
+ * Regenerate left/right ids from parent/child relationship
+ *
+ * This method regenerates the left/right ids for the tree based on
+ * the parent/child relations. This function executes three queries per
+ * item, so it should only be called, when the set has one of the following
+ * problems:
+ * - The set has a duplicated value inside the left/right id chain
+ * - The set has a missing value inside the left/right id chain
+ * - The set has items that do not have a left/right is set
+ *
+ * When regenerating the items, the items are sorted by parent id and their
+ * current left id, so the current child/parent relationships are kept
+ * and running the function on a working set will not change any orders.
+ *
+ * @param int $new_id First left_id to be used (should start with 1)
+ * @param int $parent_id parent_id of the current set (default = 0)
+ * @param bool $reset_ids Should we reset all left_id/right_id on the first call?
+ * @return int $new_id The next left_id/right_id that should be used
*/
public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids = false)
{