Tutorial Extension  1.0.0
SellerDeck Extensions - Tutorial Extension
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CMockAccessOdbcPdoStatement Class Reference

Public Member Functions

 __construct ($oConnection, $sQuery)
 
 bindValue ($sParam, $vValue)
 
 execute ()
 
 fetch ($vOption=null)
 

Protected Member Functions

 extractParam ($sQuery)
 
 clearParam ()
 

Protected Attributes

 $m_sQuery
 
 $m_aParams
 
 $m_oStatement
 

Detailed Description

Definition at line 205 of file CDataBaseAccessNoPDO.php.

Constructor & Destructor Documentation

__construct (   $oConnection,
  $sQuery 
)

__construct - Object constructor method

public

Parameters
object$oConnectionConnection
string$sQueryQuery
Returns
void

Definition at line 231 of file CDataBaseAccessNoPDO.php.

232  {
233 // $this->m_sQuery = preg_replace('/(?<=\s|^):[^\s:]++/um', '?', $sQuery);
234  $this->m_sQuery = $sQuery;
235  $this->m_aParams = null;
236  $this->extractParam($sQuery);
237  $this->m_oStatement = odbc_prepare($oConnection, $this->m_sQuery);
238  }

Member Function Documentation

bindValue (   $sParam,
  $vValue 
)

bindValue - Bind Value

public

Parameters
string$sParamParameter
mixed$vValueValue
Returns
void

Definition at line 248 of file CDataBaseAccessNoPDO.php.

249  {
250  $this->m_aParams[$sParam] = $vValue;
251  }
clearParam ( )
protected

clearParam - Clear Parameters

protected

Returns
void

Definition at line 312 of file CDataBaseAccessNoPDO.php.

313  {
314  $nIndex = 0;
315 
316  while (isset($this->m_aParams[$nIndex]))
317  {
318  $this->m_aParams[$nIndex] = null;
319  ++$nIndex;
320  }
321  }
execute ( )

execute - Execute

public

Returns
void

Definition at line 259 of file CDataBaseAccessNoPDO.php.

260  {
261  if ($this->m_aParams == null)
262  {
263  odbc_execute($this->m_oStatement);
264  }
265  else
266  {
267  odbc_execute($this->m_oStatement, $this->m_aParams);
268  }
269  $this->clearParam();
270  }
extractParam (   $sQuery)
protected

extractParam - Extract Parameters

protected

Parameters
mixed$sQueryQuery
Returns
void

Definition at line 291 of file CDataBaseAccessNoPDO.php.

292  {
293  $aQueries = explode(" ", $sQuery);
294  $nIndex = 0;
295 
296  while (isset($aQueries[$nIndex]))
297  {
298  if (preg_match("/^:/", $aQueries[$nIndex]))
299  {
300  $this->m_aParams[$aQueries[$nIndex]] = null;
301  }
302  ++$nIndex;
303  }
304  }
fetch (   $vOption = null)

fetch - Fetch

public

Parameters
mixed$vOptionOptions
Returns
array|bool An array that corresponds to the fetched row, or FALSE if there are no more rows.

Definition at line 279 of file CDataBaseAccessNoPDO.php.

280  {
281  return odbc_fetch_array($this->m_oStatement);
282  }

The documentation for this class was generated from the following file: