3 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 * This software consists of voluntary contributions made by many individuals
16 * and is licensed under the MIT license. For more information, see
17 * <http://www.doctrine-project.org>.
20 namespace Doctrine\ORM\Query\Expr;
23 * Expression class for DQL from
26 * @link www.doctrine-project.org
28 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
29 * @author Jonathan Wage <jonwage@gmail.com>
30 * @author Roman Borschel <roman@code-factory.org>
34 const INNER_JOIN = 'INNER';
35 const LEFT_JOIN = 'LEFT';
58 protected $conditionType;
71 * @param string $joinType The condition type constant. Either INNER_JOIN or LEFT_JOIN.
72 * @param string $join The relationship to join
73 * @param string $alias The alias of the join
74 * @param string $conditionType The condition type constant. Either ON or WITH.
75 * @param string $condition The condition for the join
76 * @param string $indexBy The index for the join
78 public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null)
80 $this->joinType = $joinType;
82 $this->alias = $alias;
83 $this->conditionType = $conditionType;
84 $this->condition = $condition;
85 $this->indexBy = $indexBy;
91 public function getJoinType()
93 return $this->joinType;
99 public function getJoin()
107 public function getAlias()
115 public function getConditionType()
117 return $this->conditionType;
123 public function getCondition()
125 return $this->condition;
131 public function getIndexBy()
133 return $this->indexBy;
140 public function __toString()
142 return strtoupper($this->joinType) . ' JOIN ' . $this->join
143 . ($this->alias ? ' ' . $this->alias : '')
144 . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : '')
145 . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '');