phpbb_container = $phpbb_container; // Service $this->service = $phpbb_container->get('notifications'); // Some common things we're going to use $this->db = $phpbb_container->get('dbal.conn'); $this->user = $phpbb_container->get('user'); $this->phpbb_root_path = $phpbb_container->getParameter('core.root_path'); $this->php_ext = $phpbb_container->getParameter('core.php_ext'); } /** * Add a notification to the queue * * @param phpbb_notifications_type_interface $notification */ public function add_to_queue(phpbb_notifications_type_interface $notification) { $this->queue[] = $notification; } /** * Basic run queue function. * Child methods should override this function if there are more efficient methods to mass-notification */ public function run_queue() { foreach ($this->queue as $notification) { $this->notify($notification); } $this->empty_queue(); } protected function empty_queue() { $this->queue = array(); } }