public function getData($unique = false)
    {
        $data = array();

        foreach ($this->_data as $name => $state) {
            if (isset($state->value)) {
                //Only return unique data
                if ($unique) {
                    //Unique values cannot be null or an empty string
                    if ($state->unique && $this->_validate($state)) {
                        $result = true;

                        //Check related states to see if they are set
                        foreach ($state->required as $required) {
                            if (!$this->_validate($this->_data[$required])) {
                                $result = false;
                                break;
                            }
                        }

                        //Prepare the data to be returned. Include states
                        if ($result) {
                            $data[$name] = $state->value;

                            foreach ($state->required as $required) {
                                $data[$required] = $this->_data[$required]->value;
                            }
                        }
                    }
                } else {
                    $data[$name] = $state->value;
                }
            }
        }

        return $data;
    }
public function getData($unique = false)
    {
        $data = array();

        foreach ($this->_data as $name => $state) {
            if (isset($state->value)) {
                //Only return unique data
                if ($unique) {
                    //Unique values cannot be null or an empty string
                    if ($state->unique && $this->_validate($state)) {
                        $result = true;

                        //Check related states to see if they are set
                        foreach ($state->required as $required) {
                            if (!$this->_validate($this->_data[$required])) {
                                $result = false;
                                break;
                            }
                        }

                        //Prepare the data to be returned. Include states
                        if ($result) {
                            $data[$name] = $state->value;

                            foreach ($state->required as $required) {
                                $data[$required] = $this->_data[$required]->value;
                            }
                        }
                    }
                } else {
                    $data[$name] = $state->value;
                }
            }
        }

        return $data;
    }
public function getData ( $ unique = false ) { $ data = array ( ) ; foreach ( $ this -> _data as $ name => $ state ) { if ( isset ( $ state -> value ) ) { //Only return unique data if ( $ unique ) { //Unique values cannot be null or an empty string if ( $ state -> unique && $ this -> _validate ( $ state ) ) { $ result = true ; //Check related states to see if they are set foreach ( $ state -> required as $ required ) { if ( ! $ this -> _validate ( $ this -> _data [ $ required ] ) ) { $ result = false ; break ; } } //Prepare the data to be returned. Include states if ( $ result ) { $ data [ $ name ] = $ state -> value ; foreach ( $ state -> required as $ required ) { $ data [ $ required ] = $ this -> _data [ $ required ] -> value ; } } } } else { $ data [ $ name ] = $ state -> value ; } } } return $ data ; }
Get the state data

This function only returns states that have been been set.

@param   boolean If TRUE only retrieve unique state values, default FALSE
@return  array   An associative array of state values by name
Get the state data