Documentation

Sql extends AbstractSql
in package

Sql class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.3.0

Table of Contents

BACKTICK  = 'BACKTICK'
Constants for id quote types
BRACKET  = 'BRACKET'
DOUBLE_QUOTE  = 'DOUBLE_QUOTE'
MYSQL  = 'MYSQL'
Constants for database types
NO_QUOTE  = 'NO_QUOTE'
PGSQL  = 'PGSQL'
SQLITE  = 'SQLITE'
SQLSRV  = 'SQLSRV'
$closeQuote  : string
ID close quote
$db  : AbstractAdapter
Database object
$dbType  : int
Database type
$delete  : Delete
Delete object
$idQuoteType  : string
ID quote type
$insert  : Insert
Insert object
$openQuote  : string
ID open quote
$parameterCount  : int
Parameter count
$placeholder  : string
SQL placeholder
$select  : Select
Select object
$update  : Update
Update object
__construct()  : mixed
Constructor
__toString()  : string
Render the SQL statement
db()  : AbstractAdapter
Get the current database adapter object (alias method)
decrementParameterCount()  : static
Decrement parameter count
delete()  : Delete
Access the delete object
getCloseQuote()  : string
Get close quote
getDb()  : AbstractAdapter
Get the current database adapter object
getDbType()  : int
Get the current database type
getIdQuoteType()  : int
Get the quote ID type
getOpenQuote()  : string
Get open quote
getParameter()  : string
Get parameter placeholder value
getParameterCount()  : int
Get parameter count
getPlaceholder()  : string
Get the SQL placeholder
hasDelete()  : bool
Determine if SQL object has a delete object
hasInsert()  : bool
Determine if SQL object has a insert object
hasSelect()  : bool
Determine if SQL object has a select object
hasUpdate()  : bool
Determine if SQL object has a update object
incrementParameterCount()  : static
Increment parameter count
insert()  : Insert
Access the insert object
isMysql()  : bool
Determine if the DB type is MySQL
isParameter()  : bool
Check if value is parameter placeholder
isPgsql()  : bool
Determine if the DB type is PostgreSQL
isSqlite()  : bool
Determine if the DB type is SQLite
isSqlsrv()  : bool
Determine if the DB type is SQL Server
quote()  : string
Quote the value (if it is not a numeric value)
quoteId()  : string
Quote the identifier
render()  : string
Render the SQL statement
reset()  : Sql
Reset and clear the SQL object
select()  : Select
Access the select object
setIdQuoteType()  : AbstractSql
Set the quote ID type
setPlaceholder()  : AbstractSql
Set the placeholder
update()  : Update
Access the update object
init()  : void
Initialize SQL object
initQuoteType()  : void
Initialize quite type

Constants

BACKTICK

Constants for id quote types

public mixed BACKTICK = 'BACKTICK'

DOUBLE_QUOTE

public mixed DOUBLE_QUOTE = 'DOUBLE_QUOTE'

MYSQL

Constants for database types

public mixed MYSQL = 'MYSQL'

Properties

$closeQuote

ID close quote

protected string $closeQuote = null

$delete

Delete object

protected Delete $delete = null

$idQuoteType

ID quote type

protected string $idQuoteType = 'NO_QUOTE'

$insert

Insert object

protected Insert $insert = null

$openQuote

ID open quote

protected string $openQuote = null

$parameterCount

Parameter count

protected int $parameterCount = 0

$placeholder

SQL placeholder

protected string $placeholder = null

$select

Select object

protected Select $select = null

$update

Update object

protected Update $update = null

Methods

__toString()

Render the SQL statement

public __toString() : string
Return values
string

decrementParameterCount()

Decrement parameter count

public decrementParameterCount() : static
Return values
static

delete()

Access the delete object

public delete([string $table = null ]) : Delete
Parameters
$table : string = null
Return values
Delete

getCloseQuote()

Get close quote

public getCloseQuote() : string
Return values
string

getDbType()

Get the current database type

public getDbType() : int
Return values
int

getIdQuoteType()

Get the quote ID type

public getIdQuoteType() : int
Return values
int

getOpenQuote()

Get open quote

public getOpenQuote() : string
Return values
string

getParameter()

Get parameter placeholder value

public getParameter(mixed $value[, string $column = null ]) : string
Parameters
$value : mixed
$column : string = null
Return values
string

getParameterCount()

Get parameter count

public getParameterCount() : int
Return values
int

getPlaceholder()

Get the SQL placeholder

public getPlaceholder() : string
Return values
string

hasDelete()

Determine if SQL object has a delete object

public hasDelete() : bool
Return values
bool

hasInsert()

Determine if SQL object has a insert object

public hasInsert() : bool
Return values
bool

hasSelect()

Determine if SQL object has a select object

public hasSelect() : bool
Return values
bool

hasUpdate()

Determine if SQL object has a update object

public hasUpdate() : bool
Return values
bool

incrementParameterCount()

Increment parameter count

public incrementParameterCount() : static
Return values
static

insert()

Access the insert object

public insert([string $table = null ]) : Insert
Parameters
$table : string = null
Return values
Insert

isMysql()

Determine if the DB type is MySQL

public isMysql() : bool
Return values
bool

isParameter()

Check if value is parameter placeholder

public isParameter(mixed $value[, string $column = null ]) : bool
Parameters
$value : mixed
$column : string = null
Return values
bool

isPgsql()

Determine if the DB type is PostgreSQL

public isPgsql() : bool
Return values
bool

isSqlite()

Determine if the DB type is SQLite

public isSqlite() : bool
Return values
bool

isSqlsrv()

Determine if the DB type is SQL Server

public isSqlsrv() : bool
Return values
bool

quote()

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

public quote(string $value[, bool $force = false ]) : string
Parameters
$value : string
$force : bool = false
Return values
string

quoteId()

Quote the identifier

public quoteId(string $identifier) : string
Parameters
$identifier : string
Return values
string

render()

Render the SQL statement

public render() : string
Return values
string

reset()

Reset and clear the SQL object

public reset() : Sql
Return values
Sql

select()

Access the select object

public select([mixed $columns = null ]) : Select
Parameters
$columns : mixed = null
Return values
Select

setIdQuoteType()

Set the quote ID type

public setIdQuoteType([string $type = self::NO_QUOTE ]) : AbstractSql
Parameters
$type : string = self::NO_QUOTE
Return values
AbstractSql

update()

Access the update object

public update([string $table = null ]) : Update
Parameters
$table : string = null
Return values
Update

init()

Initialize SQL object

protected init(string $adapter) : void
Parameters
$adapter : string
Return values
void

initQuoteType()

Initialize quite type

protected initQuoteType() : void
Return values
void

Search results