Passed
Push — master ( a7882a...5a7660 )
by Dark❶
02:21
created

forum_map_rsi   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_forums_cust_sql_col() 0 3 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, 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 Column.
25
	 *
26
	 * @return array
27
	 * @access protected
28
	 */
29
	protected function get_forums_cust_sql_col()
30
	{
31
		return ['dark1_rsi_f_enable'];
32
	}
33
34
	/**
35
	 * Get forum custom template row.
36
	 *
37
	 * @param array		$row	Forum row
38
	 *
39
	 * @return array
40
	 * @access protected
41
	 */
42
	protected function get_forum_cust_tpl_row($row)
43
	{
44
		$tpl_row = [];
45
		if ($row['forum_type'] == FORUM_POST)
46
		{
47
			$tpl_row = [
48
				'ENABLE'	=> $row['dark1_rsi_f_enable'],
49
			];
50
		}
51
		return $tpl_row;
52
	}
53
}
54