class Expressions (View source)

Templating like class for building SQL statements.

Examples: 'name = :name AND author = :author' 'id = IN(:ids)' 'id IN(:subselect)'

Constants

ParameterMarker

Methods

__construct($connection, $expressions = null)

No description

bind($parameter_number, $value)

Bind a value to the specific one based index. There must be a bind marker for each value bound or to_s() will throw an exception.

bind_values($values)

No description

values()

Returns all the values currently bound.

get_connection()

Returns the connection object.

set_connection(string $connection)

Sets the connection object. It is highly recommended to set this so we can use the adapter's native escaping mechanism.

to_s($substitute = false, $options = null)

No description

Details

__construct($connection, $expressions = null)

Parameters

$connection
$expressions

bind($parameter_number, $value)

Bind a value to the specific one based index. There must be a bind marker for each value bound or to_s() will throw an exception.

Parameters

$parameter_number
$value

bind_values($values)

Parameters

$values

values()

Returns all the values currently bound.

get_connection()

Returns the connection object.

set_connection(string $connection)

Sets the connection object. It is highly recommended to set this so we can use the adapter's native escaping mechanism.

Parameters

string $connection a Connection instance

to_s($substitute = false, $options = null)

Parameters

$substitute
$options