Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Doctrine\DBAL\Portability;
4
 
5
use Doctrine\DBAL\Driver\Connection as ConnectionInterface;
6
use Doctrine\DBAL\Driver\Middleware\AbstractConnectionMiddleware;
7
use Doctrine\DBAL\Driver\Result as DriverResult;
8
use Doctrine\DBAL\Driver\Statement as DriverStatement;
9
 
10
/**
11
 * Portability wrapper for a Connection.
12
 */
13
final class Connection extends AbstractConnectionMiddleware
14
{
15
    public const PORTABILITY_ALL           = 255;
16
    public const PORTABILITY_NONE          = 0;
17
    public const PORTABILITY_RTRIM         = 1;
18
    public const PORTABILITY_EMPTY_TO_NULL = 4;
19
    public const PORTABILITY_FIX_CASE      = 8;
20
 
21
    private Converter $converter;
22
 
23
    public function __construct(ConnectionInterface $connection, Converter $converter)
24
    {
25
        parent::__construct($connection);
26
 
27
        $this->converter = $converter;
28
    }
29
 
30
    public function prepare(string $sql): DriverStatement
31
    {
32
        return new Statement(
33
            parent::prepare($sql),
34
            $this->converter,
35
        );
36
    }
37
 
38
    public function query(string $sql): DriverResult
39
    {
40
        return new Result(
41
            parent::query($sql),
42
            $this->converter,
43
        );
44
    }
45
}