diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-19 16:19:01 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-19 16:19:01 +0200 |
| commit | 3d54a81ed9394f13aff4c40d524ed7cff0546604 (patch) | |
| tree | bf6adfb29876f86769560c624aa3f4bcad28f7ea /phpBB/includes/nestedset/base.php | |
| parent | d24ff2329fe145864712cb37ec19183bd4e21a42 (diff) | |
| download | forums-3d54a81ed9394f13aff4c40d524ed7cff0546604.tar forums-3d54a81ed9394f13aff4c40d524ed7cff0546604.tar.gz forums-3d54a81ed9394f13aff4c40d524ed7cff0546604.tar.bz2 forums-3d54a81ed9394f13aff4c40d524ed7cff0546604.tar.xz forums-3d54a81ed9394f13aff4c40d524ed7cff0546604.zip | |
[ticket/11495] Use item_id only as parameter for delete() and remove()
The data is acquired again anyway
PHPBB3-11495
Diffstat (limited to 'phpBB/includes/nestedset/base.php')
| -rw-r--r-- | phpBB/includes/nestedset/base.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/includes/nestedset/base.php b/phpBB/includes/nestedset/base.php index a3c878a47e..c1feb48534 100644 --- a/phpBB/includes/nestedset/base.php +++ b/phpBB/includes/nestedset/base.php @@ -113,21 +113,22 @@ abstract class phpbb_nestedset_base implements phpbb_nestedset_interface /** * @inheritdoc */ - public function remove(array $item) + public function remove($item_id) { - $items = array_keys($this->get_branch_data($item[$this->column_item_id], 'children')); + $items = $this->get_branch_data($item_id, 'children'); + $item_ids = array_keys($items); - $this->remove_subset($items, $item); + $this->remove_subset($item_ids, $items[$item_id]); - return $items; + return $item_ids; } /** * @inheritdoc */ - public function delete(array $item) + public function delete($item_id) { - $removed_items = $this->remove($item); + $removed_items = $this->remove($item_id); $sql = 'DELETE FROM ' . $this->table_name . ' WHERE ' . $this->db->sql_in_set($this->column_item_id, $removed_items) . ' |
