mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 20:13:22 +01:00
[ticket/11495] Remove add/remove from the interface
PHPBB3-11495
This commit is contained in:
parent
73d8735484
commit
abfb7bc51f
@ -18,31 +18,13 @@ 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
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user