Completed
Push — develop ( 755a17...843010 )
by Daniel
07:33
created

topic_in_queue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 39
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A get_url() 0 9 2
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2017 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\content\services\notification;
11
12
class topic_in_queue extends \phpbb\notification\type\topic_in_queue
13
{
14
	/* @var \blitze\content\services\types */
15
	protected $types;
16
17
	/**
18
	 * Notification Type Base Constructor
19
	 *
20
	 * @param \phpbb\db\driver\driver_interface $db
21
	 * @param \phpbb\language\language          $language
22
	 * @param \phpbb\user                       $user
23
	 * @param \phpbb\auth\auth                  $auth
24
	 * @param string                            $phpbb_root_path
25
	 * @param string                            $php_ext
26
	 * @param string                            $user_notifications_table
27
	 * @param \blitze\content\services\types	$types
28
	 */
29
	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table, \blitze\content\services\types $types)
30
	{
31
		parent::__construct($db, $language, $user, $auth, $phpbb_root_path, $php_ext, $user_notifications_table);
32
33
		$this->types = $types;
34
	}
35
36
	/**
37
	* Get the url to this item
38
	*
39
	* @return string URL
40
	*/
41
	public function get_url()
42
	{
43
		if ($type = $this->types->get_forum_type($this->item_parent_id))
44
		{
45
			return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=-blitze-content-mcp-content_module&amp;mode=content&amp;type=$type&amp;t={$this->item_id}&amp;do=view");
46
		}
47
48
		return parent::get_url();
49
	}
50
}
51