public function insert($name, $default = null, $unique = false, $required = array())
    {
        $state = new stdClass();
        $state->name = $name;
        $state->value = pick($this->$name, $default);
        $state->unique = $unique;
        $state->required = $required;
        $state->default = $default;
        $this->_states[$name] = $state;

        //if a default value set, then try
        //set it to the state data
        if ($this->_validate($state)) {
            $this->append(array(
                $state->name => $state->value,
            ));
        }

        return $this;
    }
public function insert($name, $default = null, $unique = false, $required = array())
    {
        $state = new stdClass();
        $state->name = $name;
        $state->value = pick($this->$name, $default);
        $state->unique = $unique;
        $state->required = $required;
        $state->default = $default;
        $this->_states[$name] = $state;

        //if a default value set, then try
        //set it to the state data
        if ($this->_validate($state)) {
            $this->append(array(
                $state->name => $state->value,
            ));
        }

        return $this;
    }
public function insert ( $ name , $ default = null , $ unique = false , $ required = array ( ) ) { $ state = new stdClass ( ) ; $ state -> name = $ name ; $ state -> value = pick ( $ this -> $ name , $ default ) ; $ state -> unique = $ unique ; $ state -> required = $ required ; $ state -> default = $ default ; $ this -> _states [ $ name ] = $ state ; //if a default value set, then try //set it to the state data if ( $ this -> _validate ( $ state ) ) { $ this -> append ( array ( $ state -> name => $ state -> value , ) ) ; } return $ this ; }
Insert a new state. This state can uniquely identify a resources or set of resoruces.

@param   string      The name of the state
@param   mixed       The default value of the state
@param   bool     TRUE if the state uniquely indetifies an enitity, FALSE otherwise. Default FALSE.
@param   array       Array of required states to determine if the state is unique. Only applicable if the state is unqiue.

@return AnConfigState
Insert a new state . This state can uniquely identify a resources or set of resoruces .