CMssqlPdoAdapter
包 | system.db.schema.mssql |
---|---|
继承 | class CMssqlPdoAdapter » PDO |
源码 | 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
公共方法
方法 | 描述 | 被定义在 |
---|---|---|
__construct() | PDO | |
__sleep() | PDO | |
__wakeup() | 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 |
方法详情
beginTransaction()
方法
public boolean beginTransaction()
| ||
{return} | boolean |
源码: framework/db/schema/mssql/CMssqlPdoAdapter.php#39 (显示)
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()
方法
public boolean commit()
| ||
{return} | boolean |
源码: framework/db/schema/mssql/CMssqlPdoAdapter.php#53 (显示)
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()
方法
public integer lastInsertId(string|null $sequence=NULL)
| ||
$sequence | string|null | sequence name. Defaults to null |
{return} | integer | last inserted id |
源码: framework/db/schema/mssql/CMssqlPdoAdapter.php#26 (显示)
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()
方法
public boolean rollBack()
| ||
{return} | boolean |
源码: framework/db/schema/mssql/CMssqlPdoAdapter.php#67 (显示)
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