summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php
blob: bdf9b2f84310d58f328477c724b1406fecc4f402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Driver\Middleware;

use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\Driver\Result;
use Doctrine\DBAL\Driver\Statement;

abstract class AbstractConnectionMiddleware implements Connection
{
    public function __construct(private readonly Connection $wrappedConnection)
    {
    }

    public function prepare(string $sql): Statement
    {
        return $this->wrappedConnection->prepare($sql);
    }

    public function query(string $sql): Result
    {
        return $this->wrappedConnection->query($sql);
    }

    public function quote(string $value): string
    {
        return $this->wrappedConnection->quote($value);
    }

    public function exec(string $sql): int|string
    {
        return $this->wrappedConnection->exec($sql);
    }

    public function lastInsertId(): int|string
    {
        return $this->wrappedConnection->lastInsertId();
    }

    public function beginTransaction(): void
    {
        $this->wrappedConnection->beginTransaction();
    }

    public function commit(): void
    {
        $this->wrappedConnection->commit();
    }

    public function rollBack(): void
    {
        $this->wrappedConnection->rollBack();
    }

    public function getServerVersion(): string
    {
        return $this->wrappedConnection->getServerVersion();
    }

    /**
     * {@inheritDoc}
     */
    public function getNativeConnection()
    {
        return $this->wrappedConnection->getNativeConnection();
    }
}