0 follower

CMssqlPdoAdapter

Package system.db.schema.mssql
Inheritance class CMssqlPdoAdapter » PDO
Source Code framework/db/schema/mssql/CMssqlPdoAdapter.php
This is an extension of default PDO class for mssql driver only It provides some missing functionalities of pdo driver

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() PDO
beginTransaction() Begin a transaction CMssqlPdoAdapter
commit() Commit a transaction CMssqlPdoAdapter
errorCode() PDO
errorInfo() PDO
exec() PDO
getAttribute() PDO
getAvailableDrivers() PDO
inTransaction() PDO
lastInsertId() Get the last inserted id value CMssqlPdoAdapter
prepare() PDO
query() PDO
quote() PDO
rollBack() Rollback a transaction CMssqlPdoAdapter
setAttribute() PDO

Method Details

beginTransaction() method
public boolean beginTransaction()
{return} boolean
Source Code: framework/db/schema/mssql/CMssqlPdoAdapter.php#41 (show)
public function beginTransaction ()
{
    
$this->exec('BEGIN TRANSACTION');
    return 
true;
}

Begin a transaction

Is is necessary to override pdo's method, as mssql pdo drivers does not support transaction

commit() method
public boolean commit()
{return} boolean
Source Code: framework/db/schema/mssql/CMssqlPdoAdapter.php#56 (show)
public function commit ()
{
    
$this->exec('COMMIT TRANSACTION');
    return 
true;
}

Commit a transaction

Is is necessary to override pdo's method, as mssql pdo drivers does not support transaction

lastInsertId() method
public integer lastInsertId(string|null $sequence=NULL)
$sequence string|null sequence name. Defaults to null
{return} integer last inserted id
Source Code: framework/db/schema/mssql/CMssqlPdoAdapter.php#27 (show)
public function lastInsertId ($sequence=NULL)
{
    return 
$this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
}

Get the last inserted id value MSSQL doesn't support sequence, so, argument is ignored

rollBack() method
public boolean rollBack()
{return} boolean
Source Code: framework/db/schema/mssql/CMssqlPdoAdapter.php#71 (show)
public function rollBack ()
{
    
$this->exec('ROLLBACK TRANSACTION');
    return 
true;
}

Rollback a transaction

Is is necessary to override pdo's method, ac mssql pdo drivers does not support transaction