Propel 2 API
Class

Propel\Runtime\Adapter\Pdo\SqlsrvAdapter

class SqlsrvAdapter extends MssqlAdapter implements SqlAdapterInterface

This is used to connect to a MSSQL database using pdo_sqlsrv driver.

Methods

setCharset(ConnectionInterface $con, string $charset)

string concatString(string $s1, string $s2)

Returns SQL which concatenates the second string to the first.

from MssqlAdapter
string subString(string $s, integer $pos, integer $len)

Returns SQL which extracts a substring.

from MssqlAdapter
string strLength(string $s)

Returns SQL which calculates the length (in chars) of a string.

from MssqlAdapter
string quoteIdentifier(string $text)

from MssqlAdapter
string quoteIdentifierTable(string $table)

from MssqlAdapter
string random(string $seed = null)

from MssqlAdapter
void applyLimit(string $sql, integer $offset, integer $limit)

Simulated Limit/Offset

from MssqlAdapter
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)

initConnection(ConnectionInterface $con, array $settings)

boolean bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)

Details

at line 50
public setCharset(ConnectionInterface $con, string $charset)

Parameters

ConnectionInterface $con
string $charset The $string charset encoding.

Exceptions

UnsupportedEncodingException

See also

parent::setCharset()

in MssqlAdapter at line 48
public string concatString(string $s1, string $s2)

Returns SQL which concatenates the second string to the first.

Parameters

string $s1 String to concatenate.
string $s2 String to append.

Return Value

string

in MssqlAdapter at line 62
public string subString(string $s, integer $pos, integer $len)

Returns SQL which extracts a substring.

Parameters

string $s String to extract from.
integer $pos Offset to start from.
integer $len Number of characters to extract.

Return Value

string

in MssqlAdapter at line 73
public string strLength(string $s)

Returns SQL which calculates the length (in chars) of a string.

Parameters

string $s String to calculate length of.

Return Value

string

in MssqlAdapter at line 84
public string quoteIdentifier(string $text)

Parameters

string $text The identifier to quote.

Return Value

string The quoted identifier.

See also

AdapterInterface::quoteIdentifier()

in MssqlAdapter at line 95
public string quoteIdentifierTable(string $table)

Parameters

string $table The table name to quo

Return Value

string The quoted table name

See also

AdapterInterface::quoteIdentifierTable()

in MssqlAdapter at line 107
public string random(string $seed = null)

Parameters

string $seed (optional) seed value for databases that support this

Return Value

string

See also

AdapterInterface::random()

in MssqlAdapter at line 127
public void applyLimit(string $sql, integer $offset, integer $limit)

Simulated Limit/Offset

This rewrites the $sql query to apply the offset and limit.
some of the ORDER BY logic borrowed from Doctrine MsSqlPlatform

Parameters

string $sql
integer $offset
integer $limit

Return Value

void

See also

AdapterInterface::applyLimit()

at line 72
public cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)

Parameters

string $sql The sql statement
array $params array('column' => ..., 'table' => ..., 'value' => ...)
Criteria $values
DatabaseMap $dbMap

See also

parent::cleanupSQL()

at line 34
public initConnection(ConnectionInterface $con, array $settings)

Parameters

ConnectionInterface $con
array $settings An array of settings.

See also

parent::initConnection()

at line 103
public boolean bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)

Parameters

StatementInterface $stmt The statement to bind
string $parameter Parameter identifier
mixed $value The value to bind
ColumnMap $cMap The ColumnMap of the column to bind
null|integer $position The position of the parameter to bind

Return Value

boolean

See also

AdapterInterface::bindValue()