aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/tree/nestedset.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-10 14:01:09 +0200
committerNils Adermann <naderman@naderman.de>2013-09-16 00:25:27 +0200
commitb95fdacdd378877d277e261465da73deb06e50da (patch)
tree01d55340b37f412cecd2d898c302e101b8a0ed19 /phpBB/phpbb/tree/nestedset.php
parent196e1813cd37c47965eb6f254ce6a55210a1b751 (diff)
downloadforums-b95fdacdd378877d277e261465da73deb06e50da.tar
forums-b95fdacdd378877d277e261465da73deb06e50da.tar.gz
forums-b95fdacdd378877d277e261465da73deb06e50da.tar.bz2
forums-b95fdacdd378877d277e261465da73deb06e50da.tar.xz
forums-b95fdacdd378877d277e261465da73deb06e50da.zip
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
Diffstat (limited to 'phpBB/phpbb/tree/nestedset.php')
-rw-r--r--phpBB/phpbb/tree/nestedset.php38
1 files changed, 20 insertions, 18 deletions
diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php
index 79853eeaa1..171dae4d14 100644
--- a/phpBB/phpbb/tree/nestedset.php
+++ b/phpBB/phpbb/tree/nestedset.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\tree;
+
/**
* @ignore
*/
@@ -15,12 +17,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
+abstract class nestedset implements \phpbb\tree\tree_interface
{
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
- /** @var phpbb_lock_db */
+ /** @var \phpbb\lock\db */
protected $lock;
/** @var string */
@@ -58,15 +60,15 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
/**
* Construct
*
- * @param phpbb_db_driver $db Database connection
- * @param phpbb_lock_db $lock Lock class used to lock the table when moving forums around
+ * @param \phpbb\db\driver\driver $db Database connection
+ * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around
* @param string $table_name Table name
* @param string $message_prefix Prefix for the messages thrown by exceptions
* @param string $sql_where Additional SQL restrictions for the queries
* @param array $item_basic_data Array with basic item data that is stored in item_parents
* @param array $columns Array with column names to overwrite
*/
- public function __construct(phpbb_db_driver $db, phpbb_lock_db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array())
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\lock\db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array())
{
$this->db = $db;
$this->lock = $lock;
@@ -116,7 +118,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$this->lock->acquire())
{
- throw new RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
+ throw new \RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
}
return true;
@@ -184,7 +186,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
$item_id = (int) $item_id;
if (!$item_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$items = $this->get_subtree_data($item_id);
@@ -192,7 +194,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (empty($items) || !isset($items[$item_id]))
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->remove_subset($item_ids, $items[$item_id]);
@@ -242,7 +244,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$item)
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
/**
@@ -364,7 +366,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$current_parent_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->acquire_lock();
@@ -373,7 +375,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!isset($item_data[$current_parent_id]))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$current_parent = $item_data[$current_parent_id];
@@ -389,7 +391,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (in_array($new_parent_id, $move_items))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$diff = sizeof($move_items) * 2;
@@ -413,7 +415,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
{
$this->db->sql_transaction('rollback');
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);
@@ -470,7 +472,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$item_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->acquire_lock();
@@ -479,7 +481,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!isset($item_data[$item_id]))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$item = $item_data[$item_id];
@@ -488,7 +490,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (in_array($new_parent_id, $move_items))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$diff = sizeof($move_items) * 2;
@@ -512,7 +514,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
{
$this->db->sql_transaction('rollback');
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);