final public function addAggregateColumn(Aggregate $aggregate)
    {
        $parts = explode(".", $aggregate->getAggregateColumnName());

        if (count($parts) > 1) {
            $columnName = $parts[count($parts) - 1];

            $relationships = array_slice($parts, 0, count($parts) - 1);

            $aggregate->setAliasDerivedColumn(str_replace(".", "", $aggregate->getAggregateColumnName()));
            $aggregate->setAggregateColumnName($columnName);

            $collection = $this->createIntersectionForRelationships($relationships, [$aggregate->getAlias()]);
            $collection->addAggregateColumn($aggregate);
            return $this;
        }

        $this->aggregateColumns[$aggregate->getAlias()] = $aggregate;
        $this->invalidate();

        return $this;
    }
final public function addAggregateColumn(Aggregate $aggregate)
    {
        $parts = explode(".", $aggregate->getAggregateColumnName());

        if (count($parts) > 1) {
            $columnName = $parts[count($parts) - 1];

            $relationships = array_slice($parts, 0, count($parts) - 1);

            $aggregate->setAliasDerivedColumn(str_replace(".", "", $aggregate->getAggregateColumnName()));
            $aggregate->setAggregateColumnName($columnName);

            $collection = $this->createIntersectionForRelationships($relationships, [$aggregate->getAlias()]);
            $collection->addAggregateColumn($aggregate);
            return $this;
        }

        $this->aggregateColumns[$aggregate->getAlias()] = $aggregate;
        $this->invalidate();

        return $this;
    }
final public function addAggregateColumn ( Aggregate $ aggregate ) { $ parts = explode ( "." , $ aggregate -> getAggregateColumnName ( ) ) ; if ( count ( $ parts ) > 1 ) { $ columnName = $ parts [ count ( $ parts ) - 1 ] ; $ relationships = array_slice ( $ parts , 0 , count ( $ parts ) - 1 ) ; $ aggregate -> setAliasDerivedColumn ( str_replace ( "." , "" , $ aggregate -> getAggregateColumnName ( ) ) ) ; $ aggregate -> setAggregateColumnName ( $ columnName ) ; $ collection = $ this -> createIntersectionForRelationships ( $ relationships , [ $ aggregate -> getAlias ( ) ] ) ; $ collection -> addAggregateColumn ( $ aggregate ) ; return $ this ; } $ this -> aggregateColumns [ $ aggregate -> getAlias ( ) ] = $ aggregate ; $ this -> invalidate ( ) ; return $ this ; }
Adds the instruction to build an aggregate column.

Should be used in conjunction with group()

@param Aggregate $aggregate
@return $this
Adds the instruction to build an aggregate column .