mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11495] Make method names for add/remove more descriptive
PHPBB3-11495
This commit is contained in:
parent
baff4287e5
commit
a9f02d1efa
1 changed files with 4 additions and 4 deletions
|
@ -111,7 +111,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
|
||||||
|
|
||||||
$item_data[$this->column_item_id] = (int) $this->db->sql_nextid();
|
$item_data[$this->column_item_id] = (int) $this->db->sql_nextid();
|
||||||
|
|
||||||
return array_merge($item_data, $this->add($item_data));
|
return array_merge($item_data, $this->add_item_to_nestedset($item_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,7 +120,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
|
||||||
* @param array $item The item to be added
|
* @param array $item The item to be added
|
||||||
* @return bool True if the item was added
|
* @return bool True if the item was added
|
||||||
*/
|
*/
|
||||||
protected function add(array $item)
|
protected function add_item_to_nestedset(array $item)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
|
$sql = 'SELECT MAX(' . $this->column_right_id . ') AS ' . $this->column_right_id . '
|
||||||
FROM ' . $this->table_name . '
|
FROM ' . $this->table_name . '
|
||||||
|
@ -152,7 +152,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
|
||||||
* @param int $item_id The item to be deleted
|
* @param int $item_id The item to be deleted
|
||||||
* @return array Item ids that have been removed
|
* @return array Item ids that have been removed
|
||||||
*/
|
*/
|
||||||
protected function remove($item_id)
|
protected function remove_item_from_nestedset($item_id)
|
||||||
{
|
{
|
||||||
$items = $this->get_children_branch_data($item_id);
|
$items = $this->get_children_branch_data($item_id);
|
||||||
$item_ids = array_keys($items);
|
$item_ids = array_keys($items);
|
||||||
|
@ -167,7 +167,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface
|
||||||
*/
|
*/
|
||||||
public function delete($item_id)
|
public function delete($item_id)
|
||||||
{
|
{
|
||||||
$removed_items = $this->remove($item_id);
|
$removed_items = $this->remove_item_from_nestedset($item_id);
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . $this->table_name . '
|
$sql = 'DELETE FROM ' . $this->table_name . '
|
||||||
WHERE ' . $this->db->sql_in_set($this->column_item_id, $removed_items) . '
|
WHERE ' . $this->db->sql_in_set($this->column_item_id, $removed_items) . '
|
||||||
|
|
Loading…
Add table
Reference in a new issue