Documentation

Delete extends AbstractPredicateClause
in package

Delete class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
6.5.0

Table of Contents

Constants

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'

Properties

$where  : mixed
$aggregateFunctions  : array<string|int, mixed>
Supported standard SQL aggregate functions
$alias  : string|null
Alias
$closeQuote  : string|null
ID close quote
$dateTimeFunctions  : array<string|int, mixed>
Supported standard SQL date-time functions
$db  : AbstractAdapter|null
Database object
$dbType  : string|null
Database type
$idQuoteType  : string
ID quote type
$mathFunctions  : array<string|int, mixed>
Supported standard SQL math functions
$openQuote  : string|null
ID open quote
$parameterCount  : int
Parameter count
$placeholder  : string|null
SQL placeholder
$stringFunctions  : array<string|int, mixed>
Supported standard SQL string functions
$table  : mixed
Table
$values  : array<string|int, mixed>
Values
$where  : Where|null
WHERE predicate object

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic method to access $where property
__toString()  : string
Render the DELETE statement
addNamedValue()  : AbstractClause
Add a named value
addValue()  : AbstractClause
Add a value
andWhere()  : AbstractPredicateClause
Access the WHERE clause with AND
db()  : AbstractAdapter|null
Get the current database adapter object (alias method)
decrementParameterCount()  : AbstractSql
Decrement parameter count
from()  : Delete
Set from table
getAlias()  : string|null
Get the alias
getCloseQuote()  : string|null
Get close quote
getDb()  : AbstractAdapter|null
Get the current database adapter object
getDbType()  : string|null
Get the current database type
getIdQuoteType()  : string
Get the quote ID type
getOpenQuote()  : string|null
Get open quote
getParameter()  : string
Get parameter placeholder value
getParameterCount()  : int
Get parameter count
getPlaceholder()  : string|null
Get the SQL placeholder
getTable()  : string|null
Get the table
getValue()  : mixed
Get a value
getValues()  : array<string|int, mixed>
Get the values
hasAlias()  : bool
Determine if there is an alias
incrementParameterCount()  : AbstractSql
Increment parameter count
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
isSupportedFunction()  : bool
Check if value contains a standard SQL supported function
orWhere()  : AbstractPredicateClause
Access the WHERE clause with OR
quote()  : float|int|string
Quote the value (if it is not a numeric value)
quoteId()  : string
Quote the identifier
render()  : string
Render the DELETE statement
setAlias()  : AbstractClause
Set the alias
setIdQuoteType()  : AbstractSql
Set the quote ID type
setPlaceholder()  : AbstractSql
Set the placeholder
setTable()  : AbstractClause
Set the table
setValues()  : AbstractClause
Set the values
where()  : AbstractPredicateClause
Access the WHERE clause
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

$aggregateFunctions

Supported standard SQL aggregate functions

protected static array<string|int, mixed> $aggregateFunctions = ['AVG', 'COUNT', 'MAX', 'MIN', 'SUM']

$closeQuote

ID close quote

protected string|null $closeQuote = null

$dateTimeFunctions

Supported standard SQL date-time functions

protected static array<string|int, mixed> $dateTimeFunctions = ['CURRENT_DATE', 'CURRENT_TIMESTAMP', 'CURRENT_TIME', 'CURDATE', 'CURTIME', 'DATE', 'DATETIME', 'DAY', 'EXTRACT', 'GETDATE', 'HOUR', 'LOCALTIME', 'LOCALTIMESTAMP', 'MINUTE', 'MONTH', 'NOW', 'SECOND', 'TIME', 'TIMEDIFF', 'TIMESTAMP', 'UNIX_TIMESTAMP', 'YEAR']

$dbType

Database type

protected string|null $dbType = null

$idQuoteType

ID quote type

protected string $idQuoteType = 'NO_QUOTE'

$mathFunctions

Supported standard SQL math functions

protected static array<string|int, mixed> $mathFunctions = ['ABS', 'RAND', 'SQRT', 'POW', 'POWER', 'EXP', 'LN', 'LOG', 'LOG10', 'GREATEST', 'LEAST', 'DIV', 'MOD', 'ROUND', 'TRUNC', 'CEIL', 'CEILING', 'FLOOR', 'COS', 'ACOS', 'ACOSH', 'SIN', 'SINH', 'ASIN', 'ASINH', 'TAN', 'TANH', 'ATANH', 'ATAN2']

$openQuote

ID open quote

protected string|null $openQuote = null

$parameterCount

Parameter count

protected int $parameterCount = 0

$placeholder

SQL placeholder

protected string|null $placeholder = null

$stringFunctions

Supported standard SQL string functions

protected static array<string|int, mixed> $stringFunctions = ['CONCAT', 'FORMAT', 'INSTR', 'LCASE', 'LEFT', 'LENGTH', 'LOCATE', 'LOWER', 'LPAD', 'LTRIM', 'POSITION', 'QUOTE', 'REGEXP', 'REPEAT', 'REPLACE', 'REVERSE', 'RIGHT', 'RPAD', 'RTRIM', 'SPACE', 'STRCMP', 'SUBSTRING', 'SUBSTR', 'TRIM', 'UCASE', 'UPPER']

Methods

__get()

Magic method to access $where property

public __get(string $name) : mixed
Parameters
$name : string
Tags
throws
Exception

__toString()

Render the DELETE statement

public __toString() : string
Return values
string

from()

Set from table

public from(mixed $table) : Delete
Parameters
$table : mixed
Return values
Delete

getAlias()

Get the alias

public getAlias() : string|null
Return values
string|null

getCloseQuote()

Get close quote

public getCloseQuote() : string|null
Return values
string|null

getDbType()

Get the current database type

public getDbType() : string|null
Return values
string|null

getIdQuoteType()

Get the quote ID type

public getIdQuoteType() : string
Return values
string

getOpenQuote()

Get open quote

public getOpenQuote() : string|null
Return values
string|null

getParameter()

Get parameter placeholder value

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

getParameterCount()

Get parameter count

public getParameterCount() : int
Return values
int

getPlaceholder()

Get the SQL placeholder

public getPlaceholder() : string|null
Return values
string|null

getTable()

Get the table

public getTable() : string|null
Return values
string|null

getValue()

Get a value

public getValue(string $name) : mixed
Parameters
$name : string

getValues()

Get the values

public getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasAlias()

Determine if there is an alias

public hasAlias() : bool
Return values
bool

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|null $column = null ]) : bool
Parameters
$value : mixed
$column : string|null = 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

isSupportedFunction()

Check if value contains a standard SQL supported function

public static isSupportedFunction(string $value) : bool
Parameters
$value : string
Return values
bool

quote()

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

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

quoteId()

Quote the identifier

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

render()

Render the DELETE statement

public render() : string
Return values
string

setIdQuoteType()

Set the quote ID type

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

init()

Initialize SQL object

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

initQuoteType()

Initialize quite type

protected initQuoteType() : void

        
On this page

Search results