Swat/SwatTableViewOrderableColumn.php
public function getDirectionAsString(
        $direction_id = null,
        $include_nulls_ordering = true
    ) {
        if ($direction_id === null) {
            $direction_id = $this->direction;
        }

        switch ($direction_id) {
            case self::ORDER_BY_DIR_NONE:
                $direction = '';
                break;

            case self::ORDER_BY_DIR_ASCENDING:
                $direction = 'asc';
                break;

            case self::ORDER_BY_DIR_DESCENDING:
                $direction = 'desc';
                break;

            default:
                throw new SwatException(
                    sprintf("Ordering direction '%s' not found.", $direction_id)
                );
        }

        if ($include_nulls_ordering && $this->nulls_ordering !== null) {
            switch ($this->nulls_ordering) {
                case self::NULLS_FIRST:
                    $direction .= ' nulls first';
                    break;

                case self::NULLS_LAST:
                    $direction .= ' nulls last';
                    break;

                default:
                    throw new SwatException(
                        sprintf(
                            "Nulls ordering '%s' not found.",
                            $this->nulls_ordering
                        )
                    );
            }
        }

        return $direction;
    }
public function getDirectionAsString(
        $direction_id = null,
        $include_nulls_ordering = true
    ) {
        if ($direction_id === null) {
            $direction_id = $this->direction;
        }

        switch ($direction_id) {
            case self::ORDER_BY_DIR_NONE:
                $direction = '';
                break;

            case self::ORDER_BY_DIR_ASCENDING:
                $direction = 'asc';
                break;

            case self::ORDER_BY_DIR_DESCENDING:
                $direction = 'desc';
                break;

            default:
                throw new SwatException(
                    sprintf("Ordering direction '%s' not found.", $direction_id)
                );
        }

        if ($include_nulls_ordering && $this->nulls_ordering !== null) {
            switch ($this->nulls_ordering) {
                case self::NULLS_FIRST:
                    $direction .= ' nulls first';
                    break;

                case self::NULLS_LAST:
                    $direction .= ' nulls last';
                    break;

                default:
                    throw new SwatException(
                        sprintf(
                            "Nulls ordering '%s' not found.",
                            $this->nulls_ordering
                        )
                    );
            }
        }

        return $direction;
    }
public function getDirectionAsString ( $ direction_id = null , $ include_nulls_ordering = true ) { if ( $ direction_id === null ) { $ direction_id = $ this -> direction ; } switch ( $ direction_id ) { case self :: ORDER_BY_DIR_NONE : $ direction = '' ; break ; case self :: ORDER_BY_DIR_ASCENDING : $ direction = 'asc' ; break ; case self :: ORDER_BY_DIR_DESCENDING : $ direction = 'desc' ; break ; default : throw new SwatException ( sprintf ( "Ordering direction '%s' not found." , $ direction_id ) ) ; } if ( $ include_nulls_ordering && $ this -> nulls_ordering !== null ) { switch ( $ this -> nulls_ordering ) { case self :: NULLS_FIRST : $ direction .= ' nulls first' ; break ; case self :: NULLS_LAST : $ direction .= ' nulls last' ; break ; default : throw new SwatException ( sprintf ( "Nulls ordering '%s' not found." , $ this -> nulls_ordering ) ) ; } } return $ direction ; }
Gets the direction of ordering as a string

Retrieves the current ordering direction of this column or an arbitrary
direction constant as a string. The string is returned the lowercase
abbreviated form 'asc' or 'desc'.

@param integer $direction_id an optional direction constant to convert
to a string rather than using this
column's current direction.
@param boolean $include_nulls_ordering optional. If specified, an extra
string indicating the nulls
ordering behaviour is appended.

@return string the direction of ordering.
Gets the direction of ordering as a string