Passed
Push — master ( 78ff77...606203 )
by Aimeos
04:53
created

Base   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 55
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getConnection() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2011
6
 * @copyright Aimeos (aimeos.org), 2015-2022
7
 * @package MW
8
 * @subpackage DB
9
 */
10
11
12
namespace Aimeos\Base\DB\Statement;
13
14
15
/**
16
 * Base class for all statement implementations providing the parameter constants
17
 *
18
 * @package MW
19
 * @subpackage DB
20
 */
21
abstract class Base
22
{
23
	/**
24
	 * NULL values
25
	 */
26
	const PARAM_NULL = 0;
27
28
	/**
29
	 * Boolean (true/false) values
30
	 */
31
	const PARAM_BOOL = 1;
32
33
	/**
34
	 * 32bit integer values
35
	 */
36
	const PARAM_INT = 2;
37
38
	/**
39
	 * 32bit floating point values
40
	 */
41
	const PARAM_FLOAT = 3;
42
43
	/**
44
	 * String values
45
	 */
46
	const PARAM_STR = 4;
47
48
	/**
49
	 * Large objects
50
	 */
51
	const PARAM_LOB = 5;
52
53
54
	private $conn;
55
56
57
	/**
58
	 * Initializes the base object
59
	 *
60
	 * @param \Aimeos\Base\DB\Connection\Iface $conn Database connection object
61
	 */
62
	public function __construct( \Aimeos\Base\DB\Connection\Iface $conn )
63
	{
64
		$this->conn = $conn;
65
	}
66
67
68
	/**
69
	 * Returns the connection object
70
	 *
71
	 * @return \Aimeos\Base\DB\Connection\Iface Connection object
72
	 */
73
	protected function getConnection() : \Aimeos\Base\DB\Connection\Iface
74
	{
75
		return $this->conn;
76
	}
77
}
78