final public function addSort($columnName, $ascending = true)
    {
        $parts = explode(".", $columnName);

        $sort = new Sort();

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

            $relationships = array_slice($parts, 0, count($parts) - 1);
            $newColumnName = PdoRepository::getPdoParamName($columnName);
            $intersectionCollection = $this->createIntersectionForRelationships($relationships, [$columnName => $newColumnName]);
            $sort->tableAlias = $intersectionCollection->getUniqueReference();
            $sort->alias = $newColumnName;
        } else {
            $sort->alias = $columnName;
        }

        $sort->columnName = $columnName;
        $sort->ascending = $ascending;
        $this->sorts[] = $sort;

        $this->invalidate();

        return $this;
    }
final public function addSort($columnName, $ascending = true)
    {
        $parts = explode(".", $columnName);

        $sort = new Sort();

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

            $relationships = array_slice($parts, 0, count($parts) - 1);
            $newColumnName = PdoRepository::getPdoParamName($columnName);
            $intersectionCollection = $this->createIntersectionForRelationships($relationships, [$columnName => $newColumnName]);
            $sort->tableAlias = $intersectionCollection->getUniqueReference();
            $sort->alias = $newColumnName;
        } else {
            $sort->alias = $columnName;
        }

        $sort->columnName = $columnName;
        $sort->ascending = $ascending;
        $this->sorts[] = $sort;

        $this->invalidate();

        return $this;
    }
final public function addSort ( $ columnName , $ ascending = true ) { $ parts = explode ( "." , $ columnName ) ; $ sort = new Sort ( ) ; if ( count ( $ parts ) > 1 ) { $ columnName = $ parts [ count ( $ parts ) - 1 ] ; $ relationships = array_slice ( $ parts , 0 , count ( $ parts ) - 1 ) ; $ newColumnName = PdoRepository :: getPdoParamName ( $ columnName ) ; $ intersectionCollection = $ this -> createIntersectionForRelationships ( $ relationships , [ $ columnName => $ newColumnName ] ) ; $ sort -> tableAlias = $ intersectionCollection -> getUniqueReference ( ) ; $ sort -> alias = $ newColumnName ; } else { $ sort -> alias = $ columnName ; } $ sort -> columnName = $ columnName ; $ sort -> ascending = $ ascending ; $ this -> sorts [ ] = $ sort ; $ this -> invalidate ( ) ; return $ this ; }
Adds another sort condition.

@param string $columnName The name of the column to sort on.
@param bool $ascending True to sort ascending
@return $this
@throws FilterNotSupportedException
Adds another sort condition .