OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
oxlegacydb.php
Go to the documentation of this file.
1 <?php
2 
3 
7 class oxLegacyDb extends oxSuperCfg
8 {
9 
15  protected $_oDb = null;
16 
17 
23  public function setConnection($oConnection)
24  {
25  $this->_oDb = $oConnection;
26  }
27 
33  public function setFetchMode($iFetchMode)
34  {
35  $this->_oDb->setFetchMode($iFetchMode);
36 
37  }
38 
48  public function getDb($blType = true)
49  {
50 
51  return $this->_oDb;
52  }
53 
63  public function getOne($sSql, $aParams = false, $blType = true)
64  {
65  return $this->getDb($blType)->getOne($sSql, $aParams);
66  }
67 
77  public function getArray($sSql, $aParams = false, $blType = true)
78  {
79  return $this->getDb($blType)->getArray($sSql, $aParams);
80  }
81 
91  public function getRow($sSql, $aParams = false, $blType = true)
92  {
93  return $this->getDb($blType)->getRow($sSql, $aParams);
94  }
95 
105  public function getAll($sSql, $aParams = false, $blType = true)
106  {
107 
108  return $this->getDb($blType)->getAll($sSql, $aParams);
109  }
110 
120  public function select($sSql, $aParams = false, $blType = true)
121  {
122  return $this->getDb($blType)->execute($sSql, $aParams);
123  }
124 
134  public function getAssoc($sSql, $aParams = false, $blType = true)
135  {
136  return $this->getDb($blType)->getAssoc($sSql, $aParams);
137  }
138 
148  public function getCol($sSql, $aParams = false, $blType = true)
149  {
150  return $this->getDb($blType)->getCol($sSql, $aParams);
151  }
152 
164  public function selectLimit($sSql, $iRows = -1, $iOffset = -1, $aParams = false, $blType = true)
165  {
166  return $this->getDb($blType)->SelectLimit($sSql, $iRows, $iOffset, $aParams);
167  }
168 
177  public function execute($sSql, $aParams = false)
178  {
179  return $this->getDb(false)->execute($sSql, $aParams);
180  }
181 
190  public function query($sSql, $aParams = false)
191  {
192  return $this->getDb(false)->Query($sSql, $aParams);
193  }
194 
200  public function Affected_Rows()
201  {
202  return $this->getDb(false)->Affected_Rows();
203  }
204 
210  public function errorNo()
211  {
212  return $this->getDb(false)->ErrorNo();
213  }
214 
220  public function errorMsg()
221  {
222  return $this->getDb(false)->ErrorMsg();
223  }
224 
232  public function qstr($sValue)
233  {
234  return $this->getDb(false)->qstr($sValue);
235  }
236 
244  public function quote($sValue)
245  {
246  return $this->getDb(false)->quote($sValue);
247  }
248 
256  public function quoteArray($aStrArray)
257  {
258  foreach ($aStrArray as $sKey => $sString) {
259  $aStrArray[$sKey] = $this->quote($sString);
260  }
261 
262  return $aStrArray;
263  }
264 
272  public function metaColumns($sTable)
273  {
274  return $this->getDb(false)->MetaColumns($sTable);
275  }
276 
285  public function metaColumnNames($sTable, $blNumIndexes = false)
286  {
287  return $this->getDb(false)->MetaColumnNames($sTable, $blNumIndexes);
288  }
289 
295  public function startTransaction()
296  {
297  return $this->getDb(false)->execute('START TRANSACTION');
298  }
299 
305  public function commitTransaction()
306  {
307  return $this->getDb(false)->execute('COMMIT');
308  }
309 
315  public function rollbackTransaction()
316  {
317  return $this->getDb(false)->execute('ROLLBACK');
318  }
319 
328  public function setTransactionIsolationLevel($sLevel = null)
329  {
330  $blResult = false;
331 
332  $aLevels = array('READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', 'SERIALIZABLE');
333  if (in_array(strtoupper($sLevel), $aLevels)) {
334  $blResult = $this->getDb(false)->execute('SET TRANSACTION ISOLATION LEVEL ' . $sLevel);
335  }
336 
337  return $blResult;
338  }
339 
345  public function UI($iPollSecs = 5)
346  {
347  $this->getDb(false)->UI($iPollSecs);
348  }
349 
355  public function Insert_ID()
356  {
357  return $this->getDb(false)->Insert_ID();
358  }
359 }