PHP Class SQLBuilder\Driver\BaseDriver

Show file Open project: c9s/sqlbuilder Class Usage Examples

Public Properties

Property Type Description
$alwaysBindValues
$paramMarkerType
$paramNameCnt
$quoteColumn
$quoteTable
$quoter Array: array($obj,'method')

Public Methods

Method Description
allocateBind ( $value )
alwaysBindValues ( $on = true )
cast ( $value )
deflate ( $value, SQLBuilder\ArgumentArray $args = NULL ) For variable placeholder like PDO, we need 1 or 0 for boolean type,
deflateScalar ( $value )
quote ( $string ) quote & escape string with single quote
quoteColumn ( string $name ) : string Check driver option to quote column name
quoteColumns ( array $columns )
quoteIdentifier ( $id )
quoteTable ( string $name ) : string Check driver optino to quote table name
setNamedParamMarker ( ) The SQL statement can contain zero or more named (:name) or question mark (?) parameter markers
setQMarkParamMarker ( )
setQuoteColumn ( boolean $enable = true )
setQuoteTable ( boolean $enable = true )
setQuoter ( callable $quoter )

Method Details

allocateBind() public method

public allocateBind ( $value )

alwaysBindValues() public method

public alwaysBindValues ( $on = true )

cast() public method

public cast ( $value )

deflate() public method

For pgsql and mysql sql statement, we use TRUE or FALSE for boolean type. FOr sqlite sql statement: we use 1 or 0 for boolean type.
public deflate ( $value, SQLBuilder\ArgumentArray $args = NULL )
$args SQLBuilder\ArgumentArray

deflateScalar() public method

public deflateScalar ( $value )

quote() public method

quote & escape string with single quote
public quote ( $string )

quoteColumn() public method

column quote can be configured by 'quote_column' option.
public quoteColumn ( string $name ) : string
$name string column name
return string column name with/without quotes.

quoteColumns() public method

public quoteColumns ( array $columns )
$columns array

quoteIdentifier() abstract public method

abstract public quoteIdentifier ( $id )

quoteTable() public method

column quote can be configured by 'quote_table' option.
public quoteTable ( string $name ) : string
$name string table name
return string table name with/without quotes.

setNamedParamMarker() public method

The SQL statement can contain zero or more named (:name) or question mark (?) parameter markers
public setNamedParamMarker ( )

setQMarkParamMarker() public method

public setQMarkParamMarker ( )

setQuoteColumn() public method

public setQuoteColumn ( boolean $enable = true )
$enable boolean

setQuoteTable() public method

public setQuoteTable ( boolean $enable = true )
$enable boolean

setQuoter() public method

public setQuoter ( callable $quoter )
$quoter callable

Property Details

$alwaysBindValues public property

public $alwaysBindValues

$paramMarkerType public property

public $paramMarkerType

$paramNameCnt public property

public $paramNameCnt

$quoteColumn public property

public $quoteColumn

$quoteTable public property

public $quoteTable

$quoter public property

Array: array($obj,'method')
public $quoter