1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-03 23:37:39 +02:00

[ticket/11495] Use array directly instead of phpbb_nestedset_item_interface

PHPBB3-11495
This commit is contained in:
Joas Schilling
2013-04-18 00:13:19 +02:00
parent 5c379db085
commit 8c3443ba99
3 changed files with 97 additions and 103 deletions

View File

@@ -20,7 +20,7 @@ interface phpbb_nestedset_interface
/**
* Insert an item into the nested set (also insert the rows into the table)
*
* @param phpbb_nestedset_item_interface $item The item to be added
* @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);
@@ -28,96 +28,96 @@ interface phpbb_nestedset_interface
/**
* Add an item at the end of the nested set
*
* @param phpbb_nestedset_item_interface $item The item to be added
* @param array $item The item to be added
* @return bool True if the item was added
*/
public function add(phpbb_nestedset_item_interface $item);
public function add(array $item);
/**
* Remove an item from the nested set
*
* Also removes all subitems from the nested set
*
* @param phpbb_nestedset_item_interface $item The item to be removed
* @param array $item The item to be removed
* @return array Items that have been removed
*/
public function remove(phpbb_nestedset_item_interface $item);
public function remove(array $item);
/**
* Delete an item from the nested set (also deletes the rows form the table)
*
* Also deletes all subitems from the nested set
*
* @param phpbb_nestedset_item_interface $item The item to be deleted
* @param array $item The item to be deleted
* @return array Items that have been deleted
*/
public function delete(phpbb_nestedset_item_interface $item);
public function delete(array $item);
/**
* Move an item by a given delta
*
* @param phpbb_nestedset_item_interface $item The item to be moved
* @param array $item The item to be moved
* @param int $delta Number of steps to move this item, < 0 => down, > 0 => up
* @return bool True if the item was moved
*/
public function move(phpbb_nestedset_item_interface $item, $delta);
public function move(array $item, $delta);
/**
* Move an item down by 1
*
* @param phpbb_nestedset_item_interface $item The item to be moved
* @param array $item The item to be moved
* @return bool True if the item was moved
*/
public function move_down(phpbb_nestedset_item_interface $item);
public function move_down(array $item);
/**
* Move an item up by 1
*
* @param phpbb_nestedset_item_interface $item The item to be moved
* @param array $item The item to be moved
* @return bool True if the item was moved
*/
public function move_up(phpbb_nestedset_item_interface $item);
public function move_up(array $item);
/**
* Moves all children of one item to another item
*
* @param phpbb_nestedset_item_interface $current_parent The current parent item
* @param phpbb_nestedset_item_interface $new_parent The new parent item
* @param array $current_parent The current parent item
* @param array $new_parent The new parent item
* @return bool True if any items where moved
*/
public function move_children(phpbb_nestedset_item_interface $current_parent, phpbb_nestedset_item_interface $new_parent);
public function move_children(array $current_parent, array $new_parent);
/**
* Set the parent item
*
* @param phpbb_nestedset_item_interface $item The item to be moved
* @param phpbb_nestedset_item_interface $new_parent The new parent item
* @param array $item The item to be moved
* @param array $new_parent The new parent item
* @return bool True if the parent was set successfully
*/
public function set_parent(phpbb_nestedset_item_interface $item, phpbb_nestedset_item_interface $new_parent);
public function set_parent(array $item, array $new_parent);
/**
* Get branch of the item
*
* This method can return all parents, children or both of the given item
*
* @param phpbb_nestedset_item_interface $item The item to get the branch from
* @param array $item The item to get the branch from
* @param string $type One of all|parent|children
* @param bool $order_desc Order the items descending (most outer parent first)
* @param bool $include_item Should the given item be included in the list aswell
* @return array Array of items (containing all columns from the item table)
* ID => Item data
*/
public function get_branch_data(phpbb_nestedset_item_interface $item, $type, $order_desc, $include_item);
public function get_branch_data(array $item, $type, $order_desc, $include_item);
/**
* Get base information of parent items
*
* @param phpbb_nestedset_item_interface $item The item to get the parents from
* @param array $item The item to get the parents from
* @return array Array of items (containing basic columns from the item table)
* ID => Item data
*/
public function get_parent_data(phpbb_nestedset_item_interface $item);
public function get_parent_data(array $item);
/**
* Recalculate Nested Sets