diff options
| author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-11-20 18:14:48 -0600 |
|---|---|---|
| committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-11-20 22:54:16 -0600 |
| commit | 2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b (patch) | |
| tree | ab584092e7e54f50a15dd9a22ed5b31200ea03f1 /phpBB/includes/notification/method | |
| parent | d2187424da6ff2e0d4a69a6e21bac7e92f68335a (diff) | |
| download | forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.gz forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.bz2 forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.xz forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.zip | |
[ticket/11103] Create user loader class, update for DIC
Create a very basic user loader class to handle querying/storing
user data in a centralized location.
Use DIC collection service for notification types/methods.
Cleanup unused dependencies.
Fix some other issues.
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/notification/method')
| -rw-r--r-- | phpBB/includes/notification/method/base.php | 14 | ||||
| -rw-r--r-- | phpBB/includes/notification/method/email.php | 4 |
2 files changed, 12 insertions, 6 deletions
diff --git a/phpBB/includes/notification/method/base.php b/phpBB/includes/notification/method/base.php index 88ec2674be..3f85d62a09 100644 --- a/phpBB/includes/notification/method/base.php +++ b/phpBB/includes/notification/method/base.php @@ -24,6 +24,9 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth /** @var phpbb_notification_manager */ protected $notification_manager = null; + /** @var phpbb_user_loader */ + protected $user_loader = null; + /** @var dbal */ protected $db = null; @@ -58,13 +61,11 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth */ protected $queue = array(); - public function __construct(phpbb_notification_manager $notification_manager, dbal $db, phpbb_cache_driver_interface $cache, phpbb_template $template, phpbb_extension_manager $extension_manager, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext) + public function __construct(phpbb_user_loader $user_loader, dbal $db, phpbb_cache_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext) { - $this->notification_manager = $notification_manager; + $this->user_loader = $user_loader; $this->db = $db; $this->cache = $cache; - $this->template = $template; - $this->extension_manager = $extension_manager; $this->user = $user; $this->auth = $auth; $this->config = $config; @@ -72,6 +73,11 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth $this->php_ext = $php_ext; } + public function set_notification_manager(phpbb_notification_manager $notification_manager) + { + $this->notification_manager = $notification_manager; + } + /** * Add a notification to the queue * diff --git a/phpBB/includes/notification/method/email.php b/phpBB/includes/notification/method/email.php index 2ff30b177f..429dfda2ba 100644 --- a/phpBB/includes/notification/method/email.php +++ b/phpBB/includes/notification/method/email.php @@ -82,7 +82,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base $banned_users = phpbb_get_banned_user_ids($user_ids); // Load all the users we need - $this->notification_manager->load_users($user_ids); + $this->user_loader->load_users($user_ids); // Load the messenger if (!class_exists('messenger')) @@ -100,7 +100,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base continue; } - $user = $this->notification_manager->get_user($notification->user_id); + $user = $this->user_loader->get_user($notification->user_id); if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users)) { |
