Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace Doctrine\DBAL;
6
 
7
use Doctrine\DBAL\Types\Type;
8
 
9
/**
10
 * An SQL query together with its bound parameters.
11
 *
12
 * @psalm-immutable
13
 */
14
final class Query
15
{
16
    /**
17
     * The SQL query.
18
     */
19
    private string $sql;
20
 
21
    /**
22
     * The parameters bound to the query.
23
     *
24
     * @var array<mixed>
25
     */
26
    private array $params;
27
 
28
    /**
29
     * The types of the parameters bound to the query.
30
     *
31
     * @var array<Type|int|string|null>
32
     */
33
    private array $types;
34
 
35
    /**
36
     * @param array<mixed>                $params
37
     * @param array<Type|int|string|null> $types
38
     *
39
     * @psalm-suppress ImpurePropertyAssignment
40
     */
41
    public function __construct(string $sql, array $params, array $types)
42
    {
43
        $this->sql    = $sql;
44
        $this->params = $params;
45
        $this->types  = $types;
46
    }
47
 
48
    public function getSQL(): string
49
    {
50
        return $this->sql;
51
    }
52
 
53
    /** @return array<mixed> */
54
    public function getParams(): array
55
    {
56
        return $this->params;
57
    }
58
 
59
    /** @return array<Type|int|string|null> */
60
    public function getTypes(): array
61
    {
62
        return $this->types;
63
    }
64
}