|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace SilverStripe\ORM\Connect; |
|
4
|
|
|
|
|
5
|
|
|
class NullConnector extends DBConnector implements TransactionManager |
|
6
|
|
|
{ |
|
7
|
|
|
|
|
8
|
|
|
public function exec($sql, $errorLevel = E_USER_ERROR) |
|
|
|
|
|
|
9
|
|
|
{ |
|
10
|
|
|
throw new \Exception('cannot query'); |
|
11
|
|
|
} |
|
12
|
|
|
|
|
13
|
|
|
public function query($sql, $errorLevel = E_USER_ERROR) |
|
14
|
|
|
{ |
|
15
|
|
|
throw new \Exception('cannot query'); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR) |
|
19
|
|
|
{ |
|
20
|
|
|
throw new \Exception('cannot query'); |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
public function transactionStart($transactionMode = false, $sessionCharacteristics = false) |
|
24
|
|
|
{ |
|
25
|
|
|
// no-op |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function transactionEnd() |
|
29
|
|
|
{ |
|
30
|
|
|
// no-op |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function transactionRollback($savepoint = null) |
|
34
|
|
|
{ |
|
35
|
|
|
// no-op |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function transactionSavepoint($savepoint) |
|
39
|
|
|
{ |
|
40
|
|
|
// no-op |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function transactionDepth() |
|
44
|
|
|
{ |
|
45
|
|
|
// no-op |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function supportsSavepoints() |
|
49
|
|
|
{ |
|
50
|
|
|
// no-op |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function connect($parameters, $selectDB = false) |
|
54
|
|
|
{ |
|
55
|
|
|
// no-op |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function getVersion() |
|
59
|
|
|
{ |
|
60
|
|
|
// no-op |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function escapeString($value) |
|
64
|
|
|
{ |
|
65
|
|
|
return $value; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function quoteString($value) |
|
69
|
|
|
{ |
|
70
|
|
|
return $value; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function selectDatabase($name) |
|
74
|
|
|
{ |
|
75
|
|
|
// no-op |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function getSelectedDatabase() |
|
79
|
|
|
{ |
|
80
|
|
|
// no-op |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function unloadDatabase() |
|
84
|
|
|
{ |
|
85
|
|
|
// no-op |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function getLastError() |
|
89
|
|
|
{ |
|
90
|
|
|
// no-op |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getGeneratedID($table) |
|
94
|
|
|
{ |
|
95
|
|
|
// no-op |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function affectedRows() |
|
99
|
|
|
{ |
|
100
|
|
|
// no-op |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function isActive() |
|
104
|
|
|
{ |
|
105
|
|
|
return true; |
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.