summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Query/SelectQuery.php
blob: e6ef9f26c2445785bbeb35df3b1b5d0dbbd7c1ed (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
70
71
72
73
74
75
76
77
78
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Query;

final class SelectQuery
{
    /**
     * @internal This class should be instantiated only by {@link QueryBuilder}.
     *
     * @param string[] $columns
     * @param string[] $from
     * @param string[] $groupBy
     * @param string[] $orderBy
     */
    public function __construct(
        private readonly bool $distinct,
        private readonly array $columns,
        private readonly array $from,
        private readonly ?string $where,
        private readonly array $groupBy,
        private readonly ?string $having,
        private readonly array $orderBy,
        private readonly Limit $limit,
        private readonly ?ForUpdate $forUpdate,
    ) {
    }

    public function isDistinct(): bool
    {
        return $this->distinct;
    }

    /** @return string[] */
    public function getColumns(): array
    {
        return $this->columns;
    }

    /** @return string[] */
    public function getFrom(): array
    {
        return $this->from;
    }

    public function getWhere(): ?string
    {
        return $this->where;
    }

    /** @return string[] */
    public function getGroupBy(): array
    {
        return $this->groupBy;
    }

    public function getHaving(): ?string
    {
        return $this->having;
    }

    /** @return string[] */
    public function getOrderBy(): array
    {
        return $this->orderBy;
    }

    public function getLimit(): Limit
    {
        return $this->limit;
    }

    public function getForUpdate(): ?ForUpdate
    {
        return $this->forUpdate;
    }
}