summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Query/Join.php
blob: df0e2ed9eb1d7e8ddf6959ed11ec2f9b47fe1f2b (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
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Query;

/** @internal */
final class Join
{
    private function __construct(
        public readonly string $type,
        public readonly string $table,
        public readonly string $alias,
        public readonly ?string $condition,
    ) {
    }

    public static function inner(string $table, string $alias, ?string $condition): Join
    {
        return new self('INNER', $table, $alias, $condition);
    }

    public static function left(string $table, string $alias, ?string $condition): Join
    {
        return new self('LEFT', $table, $alias, $condition);
    }

    public static function right(string $table, string $alias, ?string $condition): Join
    {
        return new self('RIGHT', $table, $alias, $condition);
    }
}