oxlegacydb.php

Go to the documentation of this file.
00001 <?php
00002 
00003 
00007 class oxLegacyDb extends oxSuperCfg
00008 {
00009 
00015     protected $_oDb = null;
00016 
00017 
00023     public function setConnection($oConnection)
00024     {
00025         $this->_oDb = $oConnection;
00026     }
00027 
00033     public function setFetchMode($iFetchMode)
00034     {
00035         $this->_oDb->setFetchMode($iFetchMode);
00036 
00037     }
00038 
00046     public function getDb($blType = true)
00047     {
00048 
00049         return $this->_oDb;
00050     }
00051 
00061     public function getOne($sSql, $aParams = false, $blType = true)
00062     {
00063         return $this->getDb($blType)->getOne($sSql, $aParams);
00064     }
00065 
00075     public function getArray($sSql, $aParams = false, $blType = true)
00076     {
00077         return $this->getDb($blType)->getArray($sSql, $aParams);
00078     }
00079 
00089     public function getRow($sSql, $aParams = false, $blType = true)
00090     {
00091         return $this->getDb($blType)->getRow($sSql, $aParams);
00092     }
00093 
00103     public function getAll($sSql, $aParams = false, $blType = true)
00104     {
00105 
00106         return $this->getDb($blType)->getAll($sSql, $aParams);
00107     }
00108 
00118     public function select($sSql, $aParams = false, $blType = true)
00119     {
00120         return $this->getDb($blType)->execute($sSql, $aParams);
00121     }
00122 
00132     public function getAssoc($sSql, $aParams = false, $blType = true)
00133     {
00134         return $this->getDb($blType)->getAssoc($sSql, $aParams);
00135     }
00136 
00146     public function getCol($sSql, $aParams = false, $blType = true)
00147     {
00148         return $this->getDb($blType)->getCol($sSql, $aParams);
00149     }
00150 
00162     public function selectLimit($sSql, $iRows = -1, $iOffset = -1, $aParams = false, $blType = true)
00163     {
00164         return $this->getDb($blType)->SelectLimit($sSql, $iRows, $iOffset, $aParams);
00165     }
00166 
00175     public function execute($sSql, $aParams = false)
00176     {
00177         return $this->getDb(false)->execute($sSql, $aParams);
00178     }
00179 
00188     public function query($sSql, $aParams = false)
00189     {
00190         return $this->getDb(false)->Query($sSql, $aParams);
00191     }
00192 
00198     public function Affected_Rows()
00199     {
00200         return $this->getDb(false)->Affected_Rows();
00201     }
00202 
00208     public function errorNo()
00209     {
00210         return $this->getDb(false)->ErrorNo();
00211     }
00212 
00218     public function errorMsg()
00219     {
00220         return $this->getDb(false)->ErrorMsg();
00221     }
00222 
00230     public function qstr($sValue)
00231     {
00232         return $this->getDb(false)->qstr($sValue);
00233     }
00234 
00242     public function quote($sValue)
00243     {
00244         return $this->getDb(false)->quote($sValue);
00245     }
00246 
00254     public function quoteArray($aStrArray)
00255     {
00256         foreach ($aStrArray as $sKey => $sString) {
00257             $aStrArray[$sKey] = $this->quote($sString);
00258         }
00259 
00260         return $aStrArray;
00261     }
00262 
00270     public function metaColumns($sTable)
00271     {
00272         return $this->getDb(false)->MetaColumns($sTable);
00273     }
00274 
00283     public function metaColumnNames($sTable, $blNumIndexes = false)
00284     {
00285         return $this->getDb(false)->MetaColumnNames($sTable, $blNumIndexes);
00286     }
00287 
00293     public function startTransaction()
00294     {
00295         return $this->getDb(false)->execute('START TRANSACTION');
00296     }
00297 
00303     public function commitTransaction()
00304     {
00305         return $this->getDb(false)->execute('COMMIT');
00306     }
00307 
00313     public function rollbackTransaction()
00314     {
00315         return $this->getDb(false)->execute('ROLLBACK');
00316     }
00317 
00326     public function setTransactionIsolationLevel($sLevel = null)
00327     {
00328         $blResult = false;
00329 
00330         $aLevels = array('READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', 'SERIALIZABLE');
00331         if (in_array(strtoupper($sLevel), $aLevels)) {
00332             $blResult = $this->getDb(false)->execute('SET TRANSACTION ISOLATION LEVEL ' . $sLevel);
00333         }
00334 
00335         return $blResult;
00336     }
00337 
00343     public function UI($iPollSecs = 5)
00344     {
00345         $this->getDb(false)->UI($iPollSecs);
00346     }
00347 
00353     public function Insert_ID()
00354     {
00355         return $this->getDb(false)->Insert_ID();
00356     }
00357 }