Connection.php
2 years ago
Converter.php
2 years ago
Driver.php
2 years ago
Middleware.php
2 years ago
OptimizeFlags.php
2 years ago
Result.php
2 years ago
Statement.php
2 years ago
index.php
2 years ago
Connection.php
30 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Doctrine\DBAL\Portability; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Doctrine\DBAL\Driver\Connection as ConnectionInterface; |
| 5 | use MailPoetVendor\Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware; |
| 6 | use MailPoetVendor\Doctrine\DBAL\Driver\Result as DriverResult; |
| 7 | use MailPoetVendor\Doctrine\DBAL\Driver\Statement as DriverStatement; |
| 8 | final class Connection extends AbstractConnectionMiddleware |
| 9 | { |
| 10 | public const PORTABILITY_ALL = 255; |
| 11 | public const PORTABILITY_NONE = 0; |
| 12 | public const PORTABILITY_RTRIM = 1; |
| 13 | public const PORTABILITY_EMPTY_TO_NULL = 4; |
| 14 | public const PORTABILITY_FIX_CASE = 8; |
| 15 | private Converter $converter; |
| 16 | public function __construct(ConnectionInterface $connection, Converter $converter) |
| 17 | { |
| 18 | parent::__construct($connection); |
| 19 | $this->converter = $converter; |
| 20 | } |
| 21 | public function prepare(string $sql) : DriverStatement |
| 22 | { |
| 23 | return new Statement(parent::prepare($sql), $this->converter); |
| 24 | } |
| 25 | public function query(string $sql) : DriverResult |
| 26 | { |
| 27 | return new Result(parent::query($sql), $this->converter); |
| 28 | } |
| 29 | } |
| 30 |