2009-01-20 20:07:07 +03:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\ORM\Query\AST;
|
|
|
|
|
2009-01-20 20:07:07 +03:00
|
|
|
/**
|
|
|
|
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
|
|
|
|
*
|
|
|
|
* @author robo
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class ArithmeticExpression extends Node
|
2009-01-20 20:07:07 +03:00
|
|
|
{
|
|
|
|
private $_simpleArithmeticExpression;
|
|
|
|
private $_subselect;
|
|
|
|
|
|
|
|
public function setSimpleArithmeticExpression($simpleArithmeticExpr)
|
|
|
|
{
|
|
|
|
if ($this->_subselect) throw new Doctrine_Exception;
|
|
|
|
$this->_simpleArithmeticExpression = $simpleArithmeticExpr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setSubselect($subselect)
|
|
|
|
{
|
|
|
|
if ($this->_simpleArithmeticExpression) throw new Doctrine_Exception;
|
|
|
|
$this->_subselect = $subselect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSimpleArithmeticExpression()
|
|
|
|
{
|
|
|
|
return $this->_simpleArithmeticExpression;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSubselect()
|
|
|
|
{
|
|
|
|
return $this->_subselect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isSimpleArithmeticExpression()
|
|
|
|
{
|
|
|
|
return (bool)$this->_simpleArithmeticExpression;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isSubselect()
|
|
|
|
{
|
|
|
|
return (bool)$this->_subselect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|