src/Charcoal/Source/Database/DatabaseOrder.php
public function sql()
    {
        if ($this->active()) {
            switch ($this->mode()) {
                case self::MODE_RANDOM:
                    return $this->byRandom();

                case self::MODE_CUSTOM:
                    return $this->byCondition();

                case self::MODE_VALUES:
                    return $this->byValues();
            }

            if ($this->hasCondition()) {
                return $this->byCondition();
            }

            if ($this->hasValues()) {
                return $this->byValues();
            }

            if ($this->hasProperty()) {
                return $this->byProperty();
            }
        }

        return '';
    }
public function sql()
    {
        if ($this->active()) {
            switch ($this->mode()) {
                case self::MODE_RANDOM:
                    return $this->byRandom();

                case self::MODE_CUSTOM:
                    return $this->byCondition();

                case self::MODE_VALUES:
                    return $this->byValues();
            }

            if ($this->hasCondition()) {
                return $this->byCondition();
            }

            if ($this->hasValues()) {
                return $this->byValues();
            }

            if ($this->hasProperty()) {
                return $this->byProperty();
            }
        }

        return '';
    }
public function sql ( ) { if ( $ this -> active ( ) ) { switch ( $ this -> mode ( ) ) { case self :: MODE_RANDOM : return $ this -> byRandom ( ) ; case self :: MODE_CUSTOM : return $ this -> byCondition ( ) ; case self :: MODE_VALUES : return $ this -> byValues ( ) ; } if ( $ this -> hasCondition ( ) ) { return $ this -> byCondition ( ) ; } if ( $ this -> hasValues ( ) ) { return $ this -> byValues ( ) ; } if ( $ this -> hasProperty ( ) ) { return $ this -> byProperty ( ) ; } } return '' ; }
Converts the order into a SQL expression for the ORDER BY clause.

@return string A SQL string fragment.
Converts the order into a SQL expression for the ORDER BY clause .