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

$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

$drop

$drop : array

DROP table schema objects

Type

array

$create

$create : array

CREATE table schema objects

Type

array

$alter

$alter : array

ALTER table schema objects

Type

array

$rename

$rename : array

RENAME table schema objects

Type

array

$truncate

$truncate : array

TRUNCATE table schema objects

Type

array

$foreignKeyCheck

$foreignKeyCheck : boolean

Foreign key check flag

Type

boolean

Methods

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

create()

create(string  $table) : \Pop\Db\Sql\Schema\Create

Access the CREATE table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Create

createIfNotExists()

createIfNotExists(string  $table) : \Pop\Db\Sql\Schema\Create

Access the CREATE table object, setting IF NOT EXISTS

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Create

drop()

drop(string  $table) : \Pop\Db\Sql\Schema\Drop

Access the DROP table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Drop

dropIfExists()

dropIfExists(string  $table) : \Pop\Db\Sql\Schema\Drop

Access the DROP table object, setting IF EXISTS

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Drop

alter()

alter(string  $table) : \Pop\Db\Sql\Schema\Alter

Access the ALTER table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Alter

rename()

rename(string  $table) : \Pop\Db\Sql\Schema\Rename

Access the RENAME table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Rename

truncate()

truncate(string  $table) : \Pop\Db\Sql\Schema\Truncate

Access the TRUNCATE table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Truncate

enableForeignKeyCheck()

enableForeignKeyCheck() : \Pop\Db\Sql\Schema

Enable the foreign key check

Returns

\Pop\Db\Sql\Schema

disableForeignKeyCheck()

disableForeignKeyCheck() : \Pop\Db\Sql\Schema

Disable the foreign key check

Returns

\Pop\Db\Sql\Schema

render()

render() : string

Render the schema

Returns

string

reset()

reset() : \Pop\Db\Sql\Schema

Reset and clear the schema object

Returns

\Pop\Db\Sql\Schema

execute()

execute(boolean  $reset = true) : void

Execute the schema directly

Parameters

boolean $reset

__toString()

__toString() : string

Render the schema to string

Returns

string

init()

init(string  $adapter) : void

Initialize SQL object

Parameters

string $adapter

initQuoteType()

initQuoteType() : void

Initialize quite type

getCreateTable()

getCreateTable(string  $table) : \Pop\Db\Sql\Schema\Create

Get the CREATE table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Create

getDropTable()

getDropTable(string  $table) : \Pop\Db\Sql\Schema\Drop

Get the DROP table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Drop

getAlterTable()

getAlterTable(string  $table) : \Pop\Db\Sql\Schema\Alter

Get the ALTER table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Alter

getRenameTable()

getRenameTable(string  $table) : \Pop\Db\Sql\Schema\Rename

Get the RENAME table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Rename

getTruncateTable()

getTruncateTable(string  $table) : \Pop\Db\Sql\Schema\Truncate

Get the TRUNCATE table object

Parameters

string $table

Returns

\Pop\Db\Sql\Schema\Truncate