2009-01-19 21:40:12 +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-19 21:40:12 +03:00
|
|
|
/**
|
|
|
|
* Description of AggregateExpression
|
|
|
|
*
|
|
|
|
* @author robo
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class AggregateExpression extends Node
|
2009-01-19 21:40:12 +03:00
|
|
|
{
|
|
|
|
private $_functionName;
|
|
|
|
private $_pathExpression;
|
|
|
|
private $_isDistinct = false; // Some aggregate expressions support distinct, eg COUNT
|
|
|
|
|
|
|
|
public function __construct($functionName, $pathExpression, $isDistinct)
|
|
|
|
{
|
|
|
|
$this->_functionName = $functionName;
|
|
|
|
$this->_pathExpression = $pathExpression;
|
|
|
|
$this->_isDistinct = $isDistinct;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPathExpression()
|
|
|
|
{
|
|
|
|
return $this->_pathExpression;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isDistinct()
|
|
|
|
{
|
|
|
|
return $this->_isDistinct;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFunctionName()
|
|
|
|
{
|
|
|
|
return $this->_functionName;
|
|
|
|
}
|
2009-03-23 20:39:33 +03:00
|
|
|
|
|
|
|
public function dispatch($sqlWalker)
|
|
|
|
{
|
|
|
|
return $sqlWalker->walkAggregateExpression($this);
|
|
|
|
}
|
2009-02-20 08:46:20 +03:00
|
|
|
}
|