| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function add(...$join): self |
||
| 19 | { |
||
| 20 | $join = array_pop($join); |
||
| 21 | if (isset($this->joined_tables[$join->alias()]) && $this->joined_tables[$join->alias()] !== $join->table()) { |
||
| 22 | $res = sprintf('JOIN %s WITH ALIAS %s ALREADY ALLOCATED FOR TABLE %s', $join->table(), $join->alias(), $this->joined_tables[$join->alias()]); |
||
| 23 | throw new \Exception($res); |
||
| 24 | } |
||
| 25 | |||
| 26 | $this->joined_tables[$join->alias()] = $join->table(); |
||
| 27 | $this->joins[$join->alias()] = $join; |
||
| 28 | |||
| 29 | return $this; |
||
| 30 | } |
||
| 42 | } |