diff options
author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Query/Expr/Join.php | |
parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Query/Expr/Join.php')
-rw-r--r-- | vendor/doctrine/orm/src/Query/Expr/Join.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Query/Expr/Join.php b/vendor/doctrine/orm/src/Query/Expr/Join.php new file mode 100644 index 0000000..c3b6dc9 --- /dev/null +++ b/vendor/doctrine/orm/src/Query/Expr/Join.php | |||
@@ -0,0 +1,77 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Query\Expr; | ||
6 | |||
7 | use Stringable; | ||
8 | |||
9 | use function strtoupper; | ||
10 | |||
11 | /** | ||
12 | * Expression class for DQL join. | ||
13 | * | ||
14 | * @link www.doctrine-project.org | ||
15 | */ | ||
16 | class Join implements Stringable | ||
17 | { | ||
18 | final public const INNER_JOIN = 'INNER'; | ||
19 | final public const LEFT_JOIN = 'LEFT'; | ||
20 | |||
21 | final public const ON = 'ON'; | ||
22 | final public const WITH = 'WITH'; | ||
23 | |||
24 | /** | ||
25 | * @psalm-param self::INNER_JOIN|self::LEFT_JOIN $joinType | ||
26 | * @psalm-param self::ON|self::WITH|null $conditionType | ||
27 | */ | ||
28 | public function __construct( | ||
29 | protected string $joinType, | ||
30 | protected string $join, | ||
31 | protected string|null $alias = null, | ||
32 | protected string|null $conditionType = null, | ||
33 | protected string|Comparison|Composite|Func|null $condition = null, | ||
34 | protected string|null $indexBy = null, | ||
35 | ) { | ||
36 | } | ||
37 | |||
38 | /** @psalm-return self::INNER_JOIN|self::LEFT_JOIN */ | ||
39 | public function getJoinType(): string | ||
40 | { | ||
41 | return $this->joinType; | ||
42 | } | ||
43 | |||
44 | public function getJoin(): string | ||
45 | { | ||
46 | return $this->join; | ||
47 | } | ||
48 | |||
49 | public function getAlias(): string|null | ||
50 | { | ||
51 | return $this->alias; | ||
52 | } | ||
53 | |||
54 | /** @psalm-return self::ON|self::WITH|null */ | ||
55 | public function getConditionType(): string|null | ||
56 | { | ||
57 | return $this->conditionType; | ||
58 | } | ||
59 | |||
60 | public function getCondition(): string|Comparison|Composite|Func|null | ||
61 | { | ||
62 | return $this->condition; | ||
63 | } | ||
64 | |||
65 | public function getIndexBy(): string|null | ||
66 | { | ||
67 | return $this->indexBy; | ||
68 | } | ||
69 | |||
70 | public function __toString(): string | ||
71 | { | ||
72 | return strtoupper($this->joinType) . ' JOIN ' . $this->join | ||
73 | . ($this->alias ? ' ' . $this->alias : '') | ||
74 | . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') | ||
75 | . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); | ||
76 | } | ||
77 | } | ||