Base::getConnection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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