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 : string

Table name

Type

string

$info

$info : array

Table info

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

$ifExists

$ifExists : boolean

IF EXISTS flag

Type

boolean

$cascade

$cascade : boolean

CASCADE flag

Type

boolean

Methods

getTable()

getTable() : string

Get the table name

Returns

string

getInfo()

getInfo() : array

Get the table info

Returns

array

renderToStatements()

renderToStatements() : array

Render the table schema to an array of statements

Returns

array

render()

render() : string

Render the table schema

Returns

string

__toString()

__toString() : string

Render the table schema to string

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

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

init()

init(string  $adapter) : void

Initialize SQL object

Parameters

string $adapter

initQuoteType()

initQuoteType() : void

Initialize quite type