final public function aggregateWithRepository(Repository $repository, SqlStatement $sqlStatement, Collection $collection, &$namedParams)
    {
        $specificAggregate = $repository->getRepositorySpecificAggregate($this);

        if ($specificAggregate) {
            $specificAggregate->calculateByRepository($repository, $sqlStatement, $collection, $namedParams);

            if ($specificAggregate->calculated) {
                $this->calculated = true;

                $collection->additionalColumns[$specificAggregate->getAlias()] = [
                    "column" => new StringColumn($specificAggregate->getAlias(), 50),
                    "collection" => $collection
                ];
            }
        }
    }
final public function aggregateWithRepository(Repository $repository, SqlStatement $sqlStatement, Collection $collection, &$namedParams)
    {
        $specificAggregate = $repository->getRepositorySpecificAggregate($this);

        if ($specificAggregate) {
            $specificAggregate->calculateByRepository($repository, $sqlStatement, $collection, $namedParams);

            if ($specificAggregate->calculated) {
                $this->calculated = true;

                $collection->additionalColumns[$specificAggregate->getAlias()] = [
                    "column" => new StringColumn($specificAggregate->getAlias(), 50),
                    "collection" => $collection
                ];
            }
        }
    }
final public function aggregateWithRepository ( Repository $ repository , SqlStatement $ sqlStatement , Collection $ collection , & $ namedParams ) { $ specificAggregate = $ repository -> getRepositorySpecificAggregate ( $ this ) ; if ( $ specificAggregate ) { $ specificAggregate -> calculateByRepository ( $ repository , $ sqlStatement , $ collection , $ namedParams ) ; if ( $ specificAggregate -> calculated ) { $ this -> calculated = true ; $ collection -> additionalColumns [ $ specificAggregate -> getAlias ( ) ] = [ "column" => new StringColumn ( $ specificAggregate -> getAlias ( ) , 50 ) , "collection" => $ collection ] ; } } }
Attempts to get the repository to do the aggregation.

If no repository support is available an empty string will be returned. Otherwise a string of data understandable
to the repository will be returned.

@param  \Rhubarb\Stem\Repositories\Repository $repository
@param SqlStatement $sqlStatement
@param Collection $collection
@param $namedParams
Attempts to get the repository to do the aggregation .