1 | <?php |
||
15 | class SQLServerConnector extends DBConnector |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Connection to the DBMS. |
||
20 | * |
||
21 | * @var resource |
||
22 | */ |
||
23 | protected $dbConn = null; |
||
24 | |||
25 | /** |
||
26 | * Stores the affected rows of the last query. |
||
27 | * Used by sqlsrv functions only, as sqlsrv_rows_affected |
||
28 | * accepts a result instead of a database handle. |
||
29 | * |
||
30 | * @var integer |
||
31 | */ |
||
32 | protected $lastAffectedRows; |
||
33 | |||
34 | /** |
||
35 | * Name of the currently selected database |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $selectedDatabase = null; |
||
40 | |||
41 | public function connect($parameters, $selectDB = false) |
||
78 | |||
79 | /** |
||
80 | * Start transaction. READ ONLY not supported. |
||
81 | */ |
||
82 | public function transactionStart() |
||
89 | |||
90 | /** |
||
91 | * Commit everything inside this transaction so far |
||
92 | */ |
||
93 | public function transactionEnd() |
||
100 | |||
101 | /** |
||
102 | * Rollback or revert to a savepoint if your queries encounter problems |
||
103 | * If you encounter a problem at any point during a transaction, you may |
||
104 | * need to rollback that particular query, or return to a savepoint |
||
105 | */ |
||
106 | public function transactionRollback() |
||
113 | |||
114 | public function affectedRows() |
||
118 | |||
119 | public function getLastError() |
||
130 | |||
131 | public function isActive() |
||
135 | |||
136 | public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR) |
||
159 | |||
160 | public function query($sql, $errorLevel = E_USER_ERROR) |
||
164 | |||
165 | public function selectDatabase($name) |
||
171 | |||
172 | public function __destruct() |
||
178 | |||
179 | public function getVersion() |
||
184 | |||
185 | public function getGeneratedID($table) |
||
189 | |||
190 | public function getSelectedDatabase() |
||
194 | |||
195 | public function unloadDatabase() |
||
200 | |||
201 | /** |
||
202 | * Quotes a string, including the "N" prefix so unicode |
||
203 | * strings are saved to the database correctly. |
||
204 | * |
||
205 | * @param string $value String to be encoded |
||
206 | * @return string Processed string ready for DB |
||
207 | */ |
||
208 | public function quoteString($value) |
||
212 | |||
213 | public function escapeString($value) |
||
219 | } |
||
220 |