OXID eShop CE  4.9.5
 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 
46  public function getDb($blType = true)
47  {
48 
49  return $this->_oDb;
50  }
51 
61  public function getOne($sSql, $aParams = false, $blType = true)
62  {
63  return $this->getDb($blType)->getOne($sSql, $aParams);
64  }
65 
75  public function getArray($sSql, $aParams = false, $blType = true)
76  {
77  return $this->getDb($blType)->getArray($sSql, $aParams);
78  }
79 
89  public function getRow($sSql, $aParams = false, $blType = true)
90  {
91  return $this->getDb($blType)->getRow($sSql, $aParams);
92  }
93 
103  public function getAll($sSql, $aParams = false, $blType = true)
104  {
105 
106  return $this->getDb($blType)->getAll($sSql, $aParams);
107  }
108 
118  public function select($sSql, $aParams = false, $blType = true)
119  {
120  return $this->getDb($blType)->execute($sSql, $aParams);
121  }
122 
132  public function getAssoc($sSql, $aParams = false, $blType = true)
133  {
134  return $this->getDb($blType)->getAssoc($sSql, $aParams);
135  }
136 
146  public function getCol($sSql, $aParams = false, $blType = true)
147  {
148  return $this->getDb($blType)->getCol($sSql, $aParams);
149  }
150 
162  public function selectLimit($sSql, $iRows = -1, $iOffset = -1, $aParams = false, $blType = true)
163  {
164  return $this->getDb($blType)->SelectLimit($sSql, $iRows, $iOffset, $aParams);
165  }
166 
175  public function execute($sSql, $aParams = false)
176  {
177  return $this->getDb(false)->execute($sSql, $aParams);
178  }
179 
188  public function query($sSql, $aParams = false)
189  {
190  return $this->getDb(false)->Query($sSql, $aParams);
191  }
192 
198  public function Affected_Rows()
199  {
200  return $this->getDb(false)->Affected_Rows();
201  }
202 
208  public function errorNo()
209  {
210  return $this->getDb(false)->ErrorNo();
211  }
212 
218  public function errorMsg()
219  {
220  return $this->getDb(false)->ErrorMsg();
221  }
222 
230  public function qstr($sValue)
231  {
232  return $this->getDb(false)->qstr($sValue);
233  }
234 
242  public function quote($sValue)
243  {
244  return $this->getDb(false)->quote($sValue);
245  }
246 
254  public function quoteArray($aStrArray)
255  {
256  foreach ($aStrArray as $sKey => $sString) {
257  $aStrArray[$sKey] = $this->quote($sString);
258  }
259 
260  return $aStrArray;
261  }
262 
270  public function metaColumns($sTable)
271  {
272  return $this->getDb(false)->MetaColumns($sTable);
273  }
274 
283  public function metaColumnNames($sTable, $blNumIndexes = false)
284  {
285  return $this->getDb(false)->MetaColumnNames($sTable, $blNumIndexes);
286  }
287 
293  public function startTransaction()
294  {
295  return $this->getDb(false)->execute('START TRANSACTION');
296  }
297 
303  public function commitTransaction()
304  {
305  return $this->getDb(false)->execute('COMMIT');
306  }
307 
313  public function rollbackTransaction()
314  {
315  return $this->getDb(false)->execute('ROLLBACK');
316  }
317 
326  public function setTransactionIsolationLevel($sLevel = null)
327  {
328  $blResult = false;
329 
330  $aLevels = array('READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', 'SERIALIZABLE');
331  if (in_array(strtoupper($sLevel), $aLevels)) {
332  $blResult = $this->getDb(false)->execute('SET TRANSACTION ISOLATION LEVEL ' . $sLevel);
333  }
334 
335  return $blResult;
336  }
337 
343  public function UI($iPollSecs = 5)
344  {
345  $this->getDb(false)->UI($iPollSecs);
346  }
347 
353  public function Insert_ID()
354  {
355  return $this->getDb(false)->Insert_ID();
356  }
357 }