class SQLExpression

Abstract base class for an object representing an SQL query.

The various parts of the SQL query can be manipulated individually.

Methods

replaceText(string $old, string $new)

Swap some text in the SQL query with another.

string
__toString()

Return the generated SQL string for this query

renameTable(string $old, string $new)

Swap the use of one table with another.

bool
isEmpty()

Determine if this query is empty, and thus cannot be executed

string
sql(array $parameters = array())

Generate the SQL statement for this query.

execute()

Execute this query.

Details

at line 39
replaceText(string $old, string $new)

Swap some text in the SQL query with another.

Note that values in parameters will not be replaced

Parameters

string $old The old text (escaped)
string $new The new text (escaped)

at line 52
string __toString()

Return the generated SQL string for this query

Return Value

string

at line 71
renameTable(string $old, string $new)

Swap the use of one table with another.

Parameters

string $old Name of the old table (unquoted, escaped)
string $new Name of the new table (unquoted, escaped)

at line 83
abstract bool isEmpty()

Determine if this query is empty, and thus cannot be executed

Return Value

bool Flag indicating that this query is empty

at line 91
string sql(array $parameters = array())

Generate the SQL statement for this query.

Parameters

array $parameters Out variable for parameters required for this query

Return Value

string The completed SQL query

at line 112
Query execute()

Execute this query.

Return Value

Query