0 follower

Final Class Yiisoft\Db\Mysql\Driver

InheritanceYiisoft\Db\Mysql\Driver » Yiisoft\Db\Driver\Pdo\AbstractPdoDriver

Implements the MySQL, MariaDB driver based on the PDO (PHP Data Objects) extension.

Method Details

Hide inherited methods

createConnection() public method

public createConnection( ): PDO

                public function createConnection(): PDO
{
    $this->attributes += [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_STRINGIFY_FETCHES => true,
    ];
    $pdo = parent::createConnection();
    if ($this->charset !== null) {
        $pdo->exec('SET NAMES ' . $pdo->quote($this->charset));
    } elseif (!str_contains($this->dsn, 'charset')) {
        $pdo->exec('SET NAMES ' . $pdo->quote('utf8mb4'));
    }
    return $pdo;
}

            
getDriverName() public method

public getDriverName( ): string

                public function getDriverName(): string
{
    return 'mysql';
}