OXID eShop CE  4.8.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 
25  public function setConnection( $oConnection )
26  {
27  $this->_oDb = $oConnection;
28  }
29 
37  public function setFetchMode ( $iFetchMode )
38  {
39  $this->_oDb->setFetchMode( $iFetchMode );
40 
41  }
42 
50  public function getDb( $blType = true )
51  {
52 
53  return $this->_oDb;
54  }
55 
65  public function getOne( $sSql, $aParams = false, $blType = true )
66  {
67  return $this->getDb( $blType )->getOne( $sSql, $aParams );
68  }
69 
79  public function getArray( $sSql, $aParams = false, $blType = true )
80  {
81  return $this->getDb( $blType )->getArray( $sSql, $aParams );
82  }
83 
93  public function getRow( $sSql, $aParams = false, $blType = true )
94  {
95  return $this->getDb( $blType )->getRow( $sSql, $aParams );
96  }
97 
107  public function getAll( $sSql, $aParams = false, $blType = true )
108  {
109 
110  return $this->getDb( $blType )->getAll( $sSql, $aParams );
111  }
112 
122  public function select( $sSql, $aParams = false, $blType = true )
123  {
124  return $this->getDb( $blType )->execute( $sSql, $aParams );
125  }
126 
136  public function getAssoc( $sSql, $aParams = false, $blType = true )
137  {
138  return $this->getDb( $blType )->getAssoc( $sSql, $aParams );
139  }
140 
150  public function getCol( $sSql, $aParams = false, $blType = true )
151  {
152  return $this->getDb( $blType )->getCol( $sSql, $aParams );
153  }
154 
166  public function selectLimit( $sSql, $iRows=-1, $iOffset=-1, $aParams = false, $blType = true )
167  {
168  return $this->getDb( $blType )->SelectLimit( $sSql, $iRows, $iOffset, $aParams );
169  }
170 
179  public function execute( $sSql, $aParams = false )
180  {
181  return $this->getDb( false )->execute( $sSql, $aParams );
182  }
183 
192  public function query( $sSql, $aParams = false )
193  {
194  return $this->getDb( false )->Query( $sSql, $aParams );
195  }
196 
202  public function Affected_Rows()
203  {
204  return $this->getDb( false )->Affected_Rows();
205  }
206 
212  public function errorNo()
213  {
214  return $this->getDb( false )->ErrorNo();
215  }
216 
222  public function errorMsg()
223  {
224  return $this->getDb( false )->ErrorMsg();
225  }
226 
234  public function qstr( $sValue )
235  {
236  return $this->getDb( false )->qstr( $sValue );
237  }
238 
246  public function quote( $sValue )
247  {
248  return $this->getDb( false )->quote( $sValue );
249  }
250 
258  public function metaColumns( $sTable )
259  {
260  return $this->getDb( false )->MetaColumns( $sTable );
261  }
262 
271  public function metaColumnNames( $sTable, $blNumIndexes=false )
272  {
273  return $this->getDb( false )->MetaColumnNames( $sTable, $blNumIndexes );
274  }
275 
281  public function startTransaction()
282  {
283  return $this->getDb( false )->execute( 'START TRANSACTION' );
284  }
285 
291  public function commitTransaction()
292  {
293  return $this->getDb( false )->execute( 'COMMIT' );
294  }
295 
301  public function rollbackTransaction()
302  {
303  return $this->getDb( false )->execute( 'ROLLBACK' );
304  }
305 
314  public function setTransactionIsolationLevel( $sLevel = null )
315  {
316  $blResult = false;
317 
318  $aLevels = array( 'READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', 'SERIALIZABLE' );
319  if ( in_array( strtoupper( $sLevel ), $aLevels ) ) {
320  $blResult = $this->getDb( false )->execute( 'SET TRANSACTION ISOLATION LEVEL ' . $sLevel );
321  }
322 
323  return $blResult;
324  }
325 
333  public function UI( $iPollSecs=5 )
334  {
335  $this->getDb( false )->UI( $iPollSecs );
336  }
337 
338 }