trait EscapesValues (View source)

Shares value escaping adapters that delegate SQL literal quoting to the active connection.

Methods

string
escape(mixed $value)

Converts scalar values to SQL literals and delegates string escaping to the consuming driver.

string
string
escape_like_str(string $value)

Escapes the wildcard and escape characters used by LIKE expressions before a value is bound or quoted.

string
string
escape_str(string $value, bool $like = false)

Escapes one string value according to the consuming driver's SQL literal rules.

string

Details

escape

string escape(mixed $value)

Converts scalar values to SQL literals and delegates string escaping to the consuming driver.

Parameters

mixed $value

Return Value

string

escape_like_str

string escape_like_str(string $value)

Escapes the wildcard and escape characters used by LIKE expressions before a value is bound or quoted.

Parameters

string $value

Return Value

string

escape_str

abstract string escape_str(string $value, bool $like = false)

Escapes one string value according to the consuming driver's SQL literal rules.

Parameters

string $value
bool $like

Return Value

string