Completed
Push — development ( 7e5391...81536e )
by Stephen
21:40 queued 06:42
created

AbstractModel::_loadModsettings()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 2
dl 0
loc 11
ccs 0
cts 3
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Most of the "models" require some common stuff (like a constructor).
5
 * Here it is.
6
 *
7
 * @name      ElkArte Forum
8
 * @copyright ElkArte Forum contributors
9
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
10
 *
11
 * @version 1.1 Release Candidate 1
12
 *
13
 */
14
15
/**
16
 * Class AbstractModel
17
 *
18
 * Abstract base class for models.
19
 */
20
abstract class AbstractModel
21
{
22
	/**
23
	 * The database object
24
	 * @var database
25
	 */
26
	protected $_db = null;
27
28
	/**
29
	 * The modSettings
30
	 * @var object
31
	 */
32
	protected $_modSettings = array();
33
34
	/**
35
	 * Make "global" items available to the class
36
	 *
37
	 * @param object|null $db
38
	 */
39 19
	public function __construct($db = null)
40
	{
41 19
		global $modSettings;
42
43 19
		$this->_db = $db ?: database();
44 19
		$this->_modSettings = new \ElkArte\ValuesContainer($modSettings ?: array());
45 19
	}
46
}
47