forum_map_rsi   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 34
rs 10
c 2
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_forums_cust_sql_ary() 0 4 1
A get_forum_cust_tpl_row() 0 10 2
1
<?php
2
/**
3
 *
4
 * Reduce Search Index [RSI]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020-forever, Dark❶, https://dark1.tech
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace dark1\reducesearchindex\core;
12
13
/**
14
 * @ignore
15
 */
16
use dark1\reducesearchindex\core\forum_map;
17
18
/**
19
 * RSI Forum Mapper.
20
 */
21
class forum_map_rsi extends forum_map
22
{
23
	/**
24
	 * Get forum custom SQL Array.
25
	 *
26
	 * @param array		$sql_ary	Forum SQL Array
27
	 *
28
	 * @return array
29
	 * @access protected
30
	 */
31
	protected function get_forums_cust_sql_ary($sql_ary)
32
	{
33
		$sql_ary['SELECT'] .= ', f.dark1_rsi_f_enable';
34
		return $sql_ary;
35
	}
36
37
	/**
38
	 * Get forum custom template row.
39
	 *
40
	 * @param array		$row	Forum row
41
	 *
42
	 * @return array
43
	 * @access protected
44
	 */
45
	protected function get_forum_cust_tpl_row($row)
46
	{
47
		$tpl_row = [];
48
		if ($row['forum_type'] == FORUM_POST)
49
		{
50
			$tpl_row = [
51
				'ENABLE'	=> $row['dark1_rsi_f_enable'],
52
			];
53
		}
54
		return $tpl_row;
55
	}
56
}
57