Completed
Push — master ( 45893c...373238 )
by Angus
02:39
created

Tracker_Base_Model::__construct()   B

Complexity

Conditions 4
Paths 8

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 4.1967

Importance

Changes 0
Metric Value
cc 4
eloc 15
nc 8
nop 0
dl 0
loc 23
ccs 10
cts 13
cp 0.7692
crap 4.1967
rs 8.7972
c 0
b 0
f 0
1
<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
2
3
class Tracker_Base_Model extends CI_Model {
4
	public $sites;
5
	public $enabledCategories;
6
7 112
	public function __construct() {
8 112
		parent::__construct();
9
10 112
		$this->load->database();
11
12 112
		$this->enabledCategories = [
13
			'reading'      => 'Reading',
14
			'on-hold'      => 'On-Hold',
15
			'plan-to-read' => 'Plan to Read'
16
		];
17 112
		if($this->User_Options->get('category_custom_1') == 'enabled') {
18
			$this->enabledCategories['custom1'] = $this->User_Options->get('category_custom_1_text');
19
		}
20 112
		if($this->User_Options->get('category_custom_2') == 'enabled') {
21
			$this->enabledCategories['custom2'] = $this->User_Options->get('category_custom_2_text');
22
		}
23 112
		if($this->User_Options->get('category_custom_3') == 'enabled') {
24
			$this->enabledCategories['custom3'] = $this->User_Options->get('category_custom_3_text');
25
		}
26
27 112
		require_once(APPPATH.'models/Site_Model.php');
28 112
		$this->sites = new Sites_Model;
29 112
	}
30
}
31