public function toArray($values = true)
    {
        if ($values) {
            $result = array();
            foreach ($this->_data as $state) {
                $result[$state->name] = $state->value;
            }
        } else {
            $result = $this->_data;
        }

        return $result;
    }
public function toArray($values = true)
    {
        if ($values) {
            $result = array();
            foreach ($this->_data as $state) {
                $result[$state->name] = $state->value;
            }
        } else {
            $result = $this->_data;
        }

        return $result;
    }
public function toArray ( $ values = true ) { if ( $ values ) { $ result = array ( ) ; foreach ( $ this -> _data as $ state ) { $ result [ $ state -> name ] = $ state -> value ; } } else { $ result = $ this -> _data ; } return $ result ; }
Return an associative array of the states.

@param bool 	If TRUE return only as associative array of the state values. Default is TRUE.
@return array
Return an associative array of the states .