Swat/SwatChangeOrder.php
public function &getOrderedOptions()
    {
        if ($this->values === null) {
            $ordered_options = $this->options;
        } else {
            // copy options array so we don't modify the original
            $options = $this->options;
            $ordered_options = array();
            foreach ($this->values as $value) {
                foreach ($options as $key => $option) {
                    if ($option->value === $value) {
                        $ordered_options[] = $option;
                        unset($options[$key]);
                        break;
                    }
                }
            }

            // add leftover options
            foreach ($options as $option) {
                $ordered_options[] = $option;
            }
        }

        return $ordered_options;
    }
public function &getOrderedOptions()
    {
        if ($this->values === null) {
            $ordered_options = $this->options;
        } else {
            // copy options array so we don't modify the original
            $options = $this->options;
            $ordered_options = array();
            foreach ($this->values as $value) {
                foreach ($options as $key => $option) {
                    if ($option->value === $value) {
                        $ordered_options[] = $option;
                        unset($options[$key]);
                        break;
                    }
                }
            }

            // add leftover options
            foreach ($options as $option) {
                $ordered_options[] = $option;
            }
        }

        return $ordered_options;
    }
public function & getOrderedOptions ( ) { if ( $ this -> values === null ) { $ ordered_options = $ this -> options ; } else { // copy options array so we don't modify the original $ options = $ this -> options ; $ ordered_options = array ( ) ; foreach ( $ this -> values as $ value ) { foreach ( $ options as $ key => $ option ) { if ( $ option -> value === $ value ) { $ ordered_options [ ] = $ option ; unset ( $ options [ $ key ] ) ; break ; } } } // add leftover options foreach ( $ options as $ option ) { $ ordered_options [ ] = $ option ; } } return $ ordered_options ; }
Gets the options of this change-order control ordered by the
values of this change-order

If this control has two or more equivalent values, the order of options
having those values is arbitrary.

@return array the options of this change-order control ordered by the
values of this change-order.
Gets the options of this change - order control ordered by the values of this change - order