‪TYPO3CMS  9.5
PDOConnection.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Doctrine\DBAL\Driver\PDOConnection as DoctrineDbalPDOConnection;
20 use Doctrine\DBAL\Driver\PDOException;
21 use PDO;
22 
27 class ‪PDOConnection extends DoctrineDbalPDOConnection
28 {
32  public function ‪__construct($dsn, $user = null, $password = null, ?array $options = null)
33  {
34  try {
35  parent::__construct($dsn, $user, $password, $options);
36  $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [PDOStatement::class, []]);
37  } catch (\PDOException $exception) {
38  throw new PDOException($exception);
39  }
40  }
41 }
‪TYPO3\CMS\Core\Database\Driver
Definition: PDOConnection.php:4
‪TYPO3\CMS\Core\Database\Driver\PDOConnection
Definition: PDOConnection.php:28
‪TYPO3\CMS\Core\Database\Driver\PDOConnection\__construct
‪__construct($dsn, $user=null, $password=null, ?array $options=null)
Definition: PDOConnection.php:32