public function changeOrdering($direction)
    {
        $allowedDirections = array('asc', 'desc');
        $direction = strtolower($direction);
        $isInArray = in_array($direction, $allowedDirections, true);
        if (!empty($direction) && $isInArray) {
            if ($direction == 'asc') {
                $direction = 'desc';
            } else {
                $direction = 'asc';
            }
        }
        return $direction;
    }
public function changeOrdering($direction)
    {
        $allowedDirections = array('asc', 'desc');
        $direction = strtolower($direction);
        $isInArray = in_array($direction, $allowedDirections, true);
        if (!empty($direction) && $isInArray) {
            if ($direction == 'asc') {
                $direction = 'desc';
            } else {
                $direction = 'asc';
            }
        }
        return $direction;
    }
public function changeOrdering ( $ direction ) { $ allowedDirections = array ( 'asc' , 'desc' ) ; $ direction = strtolower ( $ direction ) ; $ isInArray = in_array ( $ direction , $ allowedDirections , true ) ; if ( ! empty ( $ direction ) && $ isInArray ) { if ( $ direction == 'asc' ) { $ direction = 'desc' ; } else { $ direction = 'asc' ; } } return $ direction ; }
change ordering
f.e. asc to desc and desc to asc
@param string $direction asc or desc
@return string desc or asc. If you call this function with a not allowed string, exactly this
string will be returned. Short: The function do nothing
change ordering f . e . asc to desc and desc to asc