Andx.php
9 months ago
Base.php
9 months ago
Comparison.php
9 months ago
Composite.php
9 months ago
From.php
9 months ago
Func.php
9 months ago
GroupBy.php
9 months ago
Join.php
9 months ago
Literal.php
9 months ago
Math.php
9 months ago
OrderBy.php
9 months ago
Orx.php
9 months ago
Select.php
9 months ago
index.php
9 months ago
Join.php
56 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\ORM\Query\Expr; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use function strtoupper; |
| 6 | class Join |
| 7 | { |
| 8 | public const INNER_JOIN = 'INNER'; |
| 9 | public const LEFT_JOIN = 'LEFT'; |
| 10 | public const ON = 'ON'; |
| 11 | public const WITH = 'WITH'; |
| 12 | protected $joinType; |
| 13 | protected $join; |
| 14 | protected $alias; |
| 15 | protected $conditionType; |
| 16 | protected $condition; |
| 17 | protected $indexBy; |
| 18 | public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null) |
| 19 | { |
| 20 | $this->joinType = $joinType; |
| 21 | $this->join = $join; |
| 22 | $this->alias = $alias; |
| 23 | $this->conditionType = $conditionType; |
| 24 | $this->condition = $condition; |
| 25 | $this->indexBy = $indexBy; |
| 26 | } |
| 27 | public function getJoinType() |
| 28 | { |
| 29 | return $this->joinType; |
| 30 | } |
| 31 | public function getJoin() |
| 32 | { |
| 33 | return $this->join; |
| 34 | } |
| 35 | public function getAlias() |
| 36 | { |
| 37 | return $this->alias; |
| 38 | } |
| 39 | public function getConditionType() |
| 40 | { |
| 41 | return $this->conditionType; |
| 42 | } |
| 43 | public function getCondition() |
| 44 | { |
| 45 | return $this->condition; |
| 46 | } |
| 47 | public function getIndexBy() |
| 48 | { |
| 49 | return $this->indexBy; |
| 50 | } |
| 51 | public function __toString() |
| 52 | { |
| 53 | return strtoupper($this->joinType) . ' JOIN ' . $this->join . ($this->alias ? ' ' . $this->alias : '') . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
| 54 | } |
| 55 | } |
| 56 |