src/ItemList.php
public function setSorting($strSortBy, $strDirection = 'ASC')
    {
        $this->strSortBy        = $strSortBy;
        $this->strSortDirection = ($strDirection == 'DESC') ? 'DESC' : 'ASC';

        return $this;
    }
public function setSorting($strSortBy, $strDirection = 'ASC')
    {
        $this->strSortBy        = $strSortBy;
        $this->strSortDirection = ($strDirection == 'DESC') ? 'DESC' : 'ASC';

        return $this;
    }
public function setSorting ( $ strSortBy , $ strDirection = 'ASC' ) { $ this -> strSortBy = $ strSortBy ; $ this -> strSortDirection = ( $ strDirection == 'DESC' ) ? 'DESC' : 'ASC' ; return $ this ; }
Set sorting to an attribute or system column optionally in the given direction.

@param string $strSortBy    The name of the attribute or system column to be used for sorting.

@param string $strDirection The direction, either ASC or DESC (optional).

@return ItemList
Set sorting to an attribute or system column optionally in the given direction .