A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.yiiframework.com/doc/api/2.0/yii-db-mssql-pdo below:

PDO, yii\db\mssql\PDO | API Documentation for Yii 2.0

Class yii\db\mssql\PDO

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.

Method Details

Hide inherited methods

Starts a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not natively support transactions.

Source code

                
public function beginTransaction()
{
    $this->exec('BEGIN TRANSACTION');
    return true;
}

            

Commits a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not natively support transactions.

Source code

                
public function commit()
{
    $this->exec('COMMIT TRANSACTION');
    return true;
}

            

Retrieve a database connection attribute.

It is necessary to override PDO's method as some MSSQL PDO driver (e.g. dblib) does not support getting attributes.

public mixed getAttribute ( $attribute ) $attribute integer

One of the PDO::ATTR_* constants.

return mixed

A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.

Source code

                
public function getAttribute($attribute)
{
    try {
        return parent::getAttribute($attribute);
    } catch (\PDOException $e) {
        switch ($attribute) {
            case self::ATTR_SERVER_VERSION:
                return $this->query("SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR)")->fetchColumn();
            default:
                throw $e;
        }
    }
}

            

Returns value of the last inserted ID.

Source code

                
public function lastInsertId($sequence = null)
{
    return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
}

            

Rollbacks a transaction. It is necessary to override PDO's method as MSSQL PDO driver does not natively support transactions.

Source code

                
public function rollBack()
{
    $this->exec('ROLLBACK TRANSACTION');
    return true;
}

            

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4