Constants

MYSQL

MYSQL = 'MYSQL'

Constants for database types

PGSQL

PGSQL = 'PGSQL'

SQLITE

SQLITE = 'SQLITE'

SQLSRV

SQLSRV = 'SQLSRV'

BACKTICK

BACKTICK = 'BACKTICK'

Constants for id quote types

BRACKET

BRACKET = 'BRACKET'

DOUBLE_QUOTE

DOUBLE_QUOTE = 'DOUBLE_QUOTE'

NO_QUOTE

NO_QUOTE = 'NO_QUOTE'

Properties

$table

$table : mixed

Table

Type

mixed

$alias

$alias : string

Alias

Type

string

$values

$values : array

Values

Type

array

$aggregateFunctions

$aggregateFunctions : array

Supported standard SQL aggregate functions

Type

array

$mathFunctions

$mathFunctions : array

Supported standard SQL math functions

Type

array

$stringFunctions

$stringFunctions : array

Supported standard SQL string functions

Type

array

$dbType

$dbType : integer

Database type

Type

integer

$placeholder

$placeholder : string

SQL placeholder

Type

string

$idQuoteType

$idQuoteType : string

ID quote type

Type

string

$openQuote

$openQuote : string

ID open quote

Type

string

$closeQuote

$closeQuote : string

ID close quote

Type

string

$parameterCount

$parameterCount : integer

Parameter count

Type

integer

Methods

andWhere()

andWhere(mixed  $where = null) : \Pop\Db\Sql\AbstractPredicateClause

Access the WHERE clause with AND

Parameters

mixed $where

Returns

\Pop\Db\Sql\AbstractPredicateClause

orWhere()

orWhere(mixed  $where = null) : \Pop\Db\Sql\AbstractPredicateClause

Access the WHERE clause with OR

Parameters

mixed $where

Returns

\Pop\Db\Sql\AbstractPredicateClause

setTable()

setTable(mixed  $table) : \Pop\Db\Sql\AbstractSql

Set the table

Parameters

mixed $table

Returns

\Pop\Db\Sql\AbstractSql

hasAlias()

hasAlias() : boolean

Determine if there is an alias

Returns

boolean

getAlias()

getAlias() : string

Get the alias

Returns

string

setAlias()

setAlias(string  $alias) : \Pop\Db\Sql\AbstractSql

Set the alias

Parameters

string $alias

Returns

\Pop\Db\Sql\AbstractSql

getTable()

getTable() : string

Get the table

Returns

string

setValues()

setValues(array  $values) : \Pop\Db\Sql\AbstractSql

Set the values

Parameters

array $values

Returns

\Pop\Db\Sql\AbstractSql

addValue()

addValue(mixed  $value) : \Pop\Db\Sql\AbstractSql

Add a value

Parameters

mixed $value

Returns

\Pop\Db\Sql\AbstractSql

addNamedValue()

addNamedValue(string  $name, mixed  $value) : \Pop\Db\Sql\AbstractSql

Add a named value

Parameters

string $name
mixed $value

Returns

\Pop\Db\Sql\AbstractSql

getValues()

getValues() : array

Get the values

Returns

array

getValue()

getValue(string  $name) : mixed

Get a value

Parameters

string $name

Returns

mixed

isSupportedFunction()

isSupportedFunction(string  $value) : boolean

Check if value contains a standard SQL supported function

Parameters

string $value

Returns

boolean

render()

render() : string

Render the UPDATE statement

Returns

string

isMysql()

isMysql() : boolean

Determine if the DB type is MySQL

Returns

boolean

isPgsql()

isPgsql() : boolean

Determine if the DB type is PostgreSQL

Returns

boolean

isSqlsrv()

isSqlsrv() : boolean

Determine if the DB type is SQL Server

Returns

boolean

isSqlite()

isSqlite() : boolean

Determine if the DB type is SQLite

Returns

boolean

setIdQuoteType()

setIdQuoteType(string  $type = self::NO_QUOTE) : \Pop\Db\Sql\AbstractSql

Set the quote ID type

Parameters

string $type

Returns

\Pop\Db\Sql\AbstractSql

setPlaceholder()

setPlaceholder(string  $placeholder) : \Pop\Db\Sql\AbstractSql

Set the placeholder

Parameters

string $placeholder

Returns

\Pop\Db\Sql\AbstractSql

getDbType()

getDbType() : integer

Get the current database type

Returns

integer

getPlaceholder()

getPlaceholder() : string

Get the SQL placeholder

Returns

string

getIdQuoteType()

getIdQuoteType() : integer

Get the quote ID type

Returns

integer

getOpenQuote()

getOpenQuote() : string

Get open quote

Returns

string

getCloseQuote()

getCloseQuote() : string

Get close quote

Returns

string

getParameterCount()

getParameterCount() : integer

Get parameter count

Returns

integer

incrementParameterCount()

incrementParameterCount() : static

Increment parameter count

Returns

static

decrementParameterCount()

decrementParameterCount() : static

Decrement parameter count

Returns

static

isParameter()

isParameter(mixed  $value, string  $column = null) : boolean

Check if value is parameter placeholder

Parameters

mixed $value
string $column

Returns

boolean

getParameter()

getParameter(mixed  $value, string  $column = null) : string

Get parameter placeholder value

Parameters

mixed $value
string $column

Returns

string

quoteId()

quoteId(string  $identifier) : string

Quote the identifier

Parameters

string $identifier

Returns

string

quote()

quote(string  $value) : string

Quote the value (if it is not a numeric value)

Parameters

string $value

Returns

string

set()

set(string  $name, mixed  $value) : \Pop\Db\Sql\Update

Set a value

Parameters

string $name
mixed $value

Returns

\Pop\Db\Sql\Update

values()

values(array  $values) : \Pop\Db\Sql\Update

Set a value

Parameters

array $values

Returns

\Pop\Db\Sql\Update

__toString()

__toString() : string

Render the UPDATE statement

Returns

string

__get()

__get(string  $name) : mixed

Magic method to access $where property

Parameters

string $name

Throws

\Pop\Db\Sql\Exception

Returns

mixed

init()

init(string  $adapter) : void

Initialize SQL object

Parameters

string $adapter

initQuoteType()

initQuoteType() : void

Initialize quite type