Code Duplication    Length = 11-12 lines in 3 locations

migrations/v10x/m2_acp_module.php 1 location

@@ 18-29 (lines=12) @@
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		$sql = 'SELECT module_id
21
			FROM ' . $this->table_prefix . "modules
22
			WHERE module_class = 'acp'
23
				AND module_langname = 'ACP_PHPBB_ADS_TITLE'";
24
		$result = $this->db->sql_query($sql);
25
		$module_id = (int) $this->db->sql_fetchfield('module_id');
26
		$this->db->sql_freeresult($result);
27
28
		return $module_id;
29
	}
30
31
	/**
32
	* {@inheritDoc}

ad/manager.php 2 locations

@@ 49-59 (lines=11) @@
46
	* @param	int		$ad_id	Advertisement ID
47
	* @return	mixed	Array with advertisement data, false if ad doesn't exist
48
	*/
49
	public function get_ad($ad_id)
50
	{
51
		$sql = 'SELECT *
52
			FROM ' . $this->ads_table . '
53
			WHERE ad_id = ' . (int) $ad_id;
54
		$result = $this->db->sql_query($sql);
55
		$data = $this->db->sql_fetchrow($result);
56
		$this->db->sql_freeresult($result);
57
58
		return $data;
59
	}
60
61
	/**
62
	* Get one ad per every location
@@ 289-299 (lines=11) @@
286
	*
287
	* @return	array	List of groups
288
	*/
289
	public function load_groups()
290
	{
291
		$sql = 'SELECT group_id, group_name, group_type
292
			FROM ' . GROUPS_TABLE . '
293
			ORDER BY group_name ASC';
294
		$result = $this->db->sql_query($sql);
295
		$groups = $this->db->sql_fetchrowset($result);
296
		$this->db->sql_freeresult($result);
297
298
		return $groups;
299
	}
300
301
	/**
302
	 * Get user_id from username