mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\notification;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
|
||||
* Notifications service class
|
||||
* @package notifications
|
||||
*/
|
||||
class phpbb_notification_manager
|
||||
class manager
|
||||
{
|
||||
/** @var array */
|
||||
protected $notification_types;
|
||||
@@ -30,16 +32,16 @@ class phpbb_notification_manager
|
||||
/** @var ContainerBuilder */
|
||||
protected $phpbb_container;
|
||||
|
||||
/** @var phpbb_user_loader */
|
||||
/** @var \phpbb\user_loader */
|
||||
protected $user_loader;
|
||||
|
||||
/** @var phpbb_db_driver */
|
||||
/** @var \phpbb\db\driver\driver */
|
||||
protected $db;
|
||||
|
||||
/** @var phpbb_cache_service */
|
||||
/** @var \phpbb\cache\service */
|
||||
protected $cache;
|
||||
|
||||
/** @var phpbb_user */
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var string */
|
||||
@@ -63,17 +65,17 @@ class phpbb_notification_manager
|
||||
* @param array $notification_types
|
||||
* @param array $notification_methods
|
||||
* @param ContainerBuilder $phpbb_container
|
||||
* @param phpbb_user_loader $user_loader
|
||||
* @param phpbb_db_driver $db
|
||||
* @param phpbb_user $user
|
||||
* @param \phpbb\user_loader $user_loader
|
||||
* @param \phpbb\db\driver\driver $db
|
||||
* @param \phpbb\user $user
|
||||
* @param string $phpbb_root_path
|
||||
* @param string $php_ext
|
||||
* @param string $notification_types_table
|
||||
* @param string $notifications_table
|
||||
* @param string $user_notifications_table
|
||||
* @return phpbb_notification_manager
|
||||
* @return \phpbb\notification\manager
|
||||
*/
|
||||
public function __construct($notification_types, $notification_methods, $phpbb_container, phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
|
||||
public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
|
||||
{
|
||||
$this->notification_types = $notification_types;
|
||||
$this->notification_methods = $notification_methods;
|
||||
@@ -377,8 +379,8 @@ class phpbb_notification_manager
|
||||
// Never send notifications to the anonymous user!
|
||||
unset($notify_users[ANONYMOUS]);
|
||||
|
||||
// Make sure not to send new notifications to users who've already been notified about this item
|
||||
// This may happen when an item was added, but now new users are able to see the item
|
||||
// Make sure not to send new \notifications to users who've already been notified about this item
|
||||
// This may happen when an item was added, but now new \users are able to see the item
|
||||
$sql = 'SELECT n.user_id
|
||||
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
|
||||
WHERE n.notification_type_id = ' . (int) $notification_type_id . '
|
||||
@@ -402,7 +404,7 @@ class phpbb_notification_manager
|
||||
$pre_create_data = $notification->pre_create_insert_array($data, $notify_users);
|
||||
unset($notification);
|
||||
|
||||
$insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $this->notifications_table);
|
||||
$insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notifications_table);
|
||||
|
||||
// Go through each user so we can insert a row in the DB and then notify them by their desired means
|
||||
foreach ($notify_users as $user => $methods)
|
||||
@@ -525,7 +527,7 @@ class phpbb_notification_manager
|
||||
{
|
||||
$type = $this->get_item_type_class($type_name);
|
||||
|
||||
if ($type instanceof phpbb_notification_type_type_interface && $type->is_available())
|
||||
if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available())
|
||||
{
|
||||
$options = array_merge(array(
|
||||
'id' => $type->get_type(),
|
||||
@@ -561,7 +563,7 @@ class phpbb_notification_manager
|
||||
{
|
||||
$method = $this->get_method_class($method_name);
|
||||
|
||||
if ($method instanceof phpbb_notification_method_method_interface && $method->is_available())
|
||||
if ($method instanceof \phpbb\notification\method\method_interface && $method->is_available())
|
||||
{
|
||||
$subscription_methods[$method_name] = array(
|
||||
'id' => $method->get_type(),
|
||||
@@ -873,7 +875,7 @@ class phpbb_notification_manager
|
||||
{
|
||||
if (!isset($this->notification_types[$notification_type_name]) && !isset($this->notification_types['notification.type.' . $notification_type_name]))
|
||||
{
|
||||
throw new phpbb_notification_exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
|
||||
throw new \phpbb\notification\exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO ' . $this->notification_types_table . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||
|
Reference in New Issue
Block a user