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

Tracker_Base_Model   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 76.92%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 10
cts 13
cp 0.7692
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 23 4
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