src/Webiny/AnalyticsDb/Query/AbstractQuery.php
public function sortByEntityName($direction)
    {
        if ($this->id != '$entity') {
            throw new AnalyticsDbException('In order to sort by entity name, you need to first group by entity name.');
        }

        $direction = (int)$direction;
        $this->pipeline['$sort'] = ['_id' => $direction];

        return $this;
    }
public function sortByEntityName($direction)
    {
        if ($this->id != '$entity') {
            throw new AnalyticsDbException('In order to sort by entity name, you need to first group by entity name.');
        }

        $direction = (int)$direction;
        $this->pipeline['$sort'] = ['_id' => $direction];

        return $this;
    }
public function sortByEntityName ( $ direction ) { if ( $ this -> id != '$entity' ) { throw new AnalyticsDbException ( 'In order to sort by entity name, you need to first group by entity name.' ) ; } $ direction = ( int ) $ direction ; $ this -> pipeline [ '$sort' ] = [ '_id' => $ direction ] ; return $ this ; }
Sorts the result by entity name.

@param string $direction Mongo sort direction: 1 => ascending; -1 => descending

@return $this
@throws AnalyticsDbException
Sorts the result by entity name .