12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace Doctrine\ORM\Query\Expr;
- class Join
- {
- const INNER_JOIN = 'INNER';
- const LEFT_JOIN = 'LEFT';
- const ON = 'ON';
- const WITH = 'WITH';
- private $_joinType;
- private $_join;
- private $_alias;
- private $_conditionType;
- private $_condition;
- private $_indexBy;
- public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null)
- {
- $this->_joinType = $joinType;
- $this->_join = $join;
- $this->_alias = $alias;
- $this->_conditionType = $conditionType;
- $this->_condition = $condition;
- $this->_indexBy = $indexBy;
- }
- public function __toString()
- {
- return strtoupper($this->_joinType) . ' JOIN ' . $this->_join
- . ($this->_alias ? ' ' . $this->_alias : '')
- . ($this->_condition ? ' ' . strtoupper($this->_conditionType) . ' ' . $this->_condition : '')
- . ($this->_indexBy ? ' INDEX BY ' . $this->_indexBy : '');
- }
- }
|