code/libraries/joomlatools/library/model/state/state.php
public function insert($name, $filter, $default = null, $unique = false, $required = array(), $internal = false)
    {
        //Create the state
        $state = new stdClass();
        $state->name     = $name;
        $state->filter   = $filter;
        $state->value    = null;
        $state->unique   = $unique;
        $state->required = $required;
        $state->default  = $default;
        $state->internal = $internal;
        $this->_data[$name] = $state;

        //Set the value to default
        if(isset($default)) {
            $this->offsetSet($name, $default);
        }

        return $this;
    }
public function insert($name, $filter, $default = null, $unique = false, $required = array(), $internal = false)
    {
        //Create the state
        $state = new stdClass();
        $state->name     = $name;
        $state->filter   = $filter;
        $state->value    = null;
        $state->unique   = $unique;
        $state->required = $required;
        $state->default  = $default;
        $state->internal = $internal;
        $this->_data[$name] = $state;

        //Set the value to default
        if(isset($default)) {
            $this->offsetSet($name, $default);
        }

        return $this;
    }
public function insert ( $ name , $ filter , $ default = null , $ unique = false , $ required = array ( ) , $ internal = false ) { //Create the state $ state = new stdClass ( ) ; $ state -> name = $ name ; $ state -> filter = $ filter ; $ state -> value = null ; $ state -> unique = $ unique ; $ state -> required = $ required ; $ state -> default = $ default ; $ state -> internal = $ internal ; $ this -> _data [ $ name ] = $ state ; //Set the value to default if ( isset ( $ default ) ) { $ this -> offsetSet ( $ name , $ default ) ; } return $ this ; }
Insert a new state

@param   string   $name     The name of the state
@param   mixed    $filter   Filter(s), can be a FilterInterface object, a filter name or an array of filter names
@param   mixed    $default  The default value of the state
@param   boolean  $unique   TRUE if the state uniquely identifies an entity, FALSE otherwise. Default FALSE.
@param   array    $required Array of required states to determine if the state is unique. Only applicable if the
state is unqiue.
@param   boolean  $internal If TRUE the state will be considered internal and should not be included in a routes.
Default FALSE.
@return  KModelState
Insert a new state