aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/tree
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-04-25 17:24:18 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-04-25 17:24:18 +0200
commitabfb7bc51fa254edd6274e39625eb8a4edec32be (patch)
tree838f1fced691dab6c8d10e9daad17c1b1ecdbcc8 /phpBB/includes/tree
parent73d873548400f18b02167ef49195a50a11970c24 (diff)
downloadforums-abfb7bc51fa254edd6274e39625eb8a4edec32be.tar
forums-abfb7bc51fa254edd6274e39625eb8a4edec32be.tar.gz
forums-abfb7bc51fa254edd6274e39625eb8a4edec32be.tar.bz2
forums-abfb7bc51fa254edd6274e39625eb8a4edec32be.tar.xz
forums-abfb7bc51fa254edd6274e39625eb8a4edec32be.zip
[ticket/11495] Remove add/remove from the interface
PHPBB3-11495
Diffstat (limited to 'phpBB/includes/tree')
-rw-r--r--phpBB/includes/tree/interface.php20
-rw-r--r--phpBB/includes/tree/nestedset.php16
2 files changed, 13 insertions, 23 deletions
diff --git a/phpBB/includes/tree/interface.php b/phpBB/includes/tree/interface.php
index babd0ad03d..3f03363151 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 tree (also insert the rows into the table)
+ * Insert an item into the tree
*
* @param array $item The item to be added
* @return array Array with item data as set in the database
@@ -26,24 +26,6 @@ interface phpbb_tree_interface
public function insert(array $additional_data);
/**
- * 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
- */
- public function add(array $item);
-
- /**
- * Remove an item from the tree
- *
- * Also removes all subitems from the tree
- *
- * @param int $item_id The item to be deleted
- * @return array Item ids that have been removed
- */
- public function remove($item);
-
- /**
* Delete an item from the tree
*
* Also deletes all subitems from the tree
diff --git a/phpBB/includes/tree/nestedset.php b/phpBB/includes/tree/nestedset.php
index 72e3aa4d71..8f73b9181e 100644
--- a/phpBB/includes/tree/nestedset.php
+++ b/phpBB/includes/tree/nestedset.php
@@ -84,9 +84,12 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
}
/**
- * @inheritdoc
+ * Add an existing item at the end of the tree
+ *
+ * @param array $item The item to be added
+ * @return bool True if the item was added
*/
- public function add(array $item)
+ protected function add(array $item)
{
$sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
FROM ' . $this->table_name . '
@@ -111,9 +114,14 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
}
/**
- * @inheritdoc
+ * Remove an item from the tree WITHOUT removing the items from the table
+ *
+ * Also removes all subitems from the tree
+ *
+ * @param int $item_id The item to be deleted
+ * @return array Item ids that have been removed
*/
- public function remove($item_id)
+ protected function remove($item_id)
{
$items = $this->get_children_branch_data($item_id);
$item_ids = array_keys($items);