Commit 90395b5d by resurtm

Refinements to MSSQL driver classes.

parent cdcb8e51
......@@ -8,18 +8,17 @@
namespace yii\db\mssql;
/**
* This is an extension of default PDO class for MSSQL and DBLIB drivers. It provides workaround for improperly
* implemented functionalities of the drivers.
* This is an extension of the default PDO class of MSSQL and DBLIB drivers.
* It provides workarounds for improperly implemented functionalities of the MSSQL and DBLIB drivers.
*
* @author Timur Ruziev <qiang.xue@gmail.com>
* @author Timur Ruziev <resurtm@gmail.com>
* @since 2.0
*/
class PDO extends \PDO
{
/**
* Returns last inserted ID value.
*
* @param string|null sequence the sequence name. Defaults to null.
* Returns value of the last inserted ID.
* @param string|null $sequence the sequence name. Defaults to null.
* @return integer last inserted ID value.
*/
public function lastInsertId($sequence = null)
......@@ -28,11 +27,9 @@ class PDO extends \PDO
}
/**
* Begin a transaction.
*
* Is is necessary to override PDO's method as MSSQL PDO drivers does not support transactions.
*
* @return boolean
* Starts a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not
* natively support transactions.
* @return boolean the result of a transaction start.
*/
public function beginTransaction()
{
......@@ -41,11 +38,9 @@ class PDO extends \PDO
}
/**
* Commit a transaction.
*
* Is is necessary to override PDO's method as MSSQL PDO drivers does not support transactions.
*
* @return boolean
* Commits a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not
* natively support transactions.
* @return boolean the result of a transaction commit.
*/
public function commit()
{
......@@ -54,11 +49,9 @@ class PDO extends \PDO
}
/**
* Rollback a transaction.
*
* Is is necessary to override PDO's method as MSSQL PDO drivers does not support transaction.
*
* @return boolean
* Rollbacks a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not
* natively support transactions.
* @return boolean the result of a transaction rollback.
*/
public function rollBack()
{
......
......@@ -8,10 +8,8 @@
namespace yii\db\mssql;
/**
* QueryBuilder is the query builder for MS SQL database (version 2008 and above).
* QueryBuilder is the query builder for MS SQL Server databases (version 2008 and above).
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @author Timur Ruziev <resurtm@gmail.com>
* @since 2.0
*/
......
......@@ -8,8 +8,8 @@
namespace yii\db\mssql;
/**
* This is an extension of default PDO class for MSSQL SQLSRV driver. It provides workaround for improperly
* implemented functionalities of the PDO SQLSRV driver.
* This is an extension of the default PDO class of SQLSRV driver.
* It provides workarounds for improperly implemented functionalities of the SQLSRV driver.
*
* @author Timur Ruziev <resurtm@gmail.com>
* @since 2.0
......@@ -17,12 +17,12 @@ namespace yii\db\mssql;
class SqlsrvPDO extends \PDO
{
/**
* Returns last inserted ID value.
*
* SQLSRV driver supports PDO::lastInsertId() with one peculiarity: when $sequence value is null
* or empty string it returns empty string. But when parameter is not specified it's working
* as expected and returns actual last inserted ID (like the other PDO drivers).
* Returns value of the last inserted ID.
*
* SQLSRV driver implements [[PDO::lastInsertId()]] method but with a single peculiarity:
* when `$sequence` value is a null or an empty string it returns an empty string.
* But when parameter is not specified it works as expected and returns actual
* last inserted ID (like the other PDO drivers).
* @param string|null $sequence the sequence name. Defaults to null.
* @return integer last inserted ID value.
*/
......
<?php
namespace yiiunit\framework\db\mssql;
class MssqlActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
public function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment