public function setAndGet($key, $fallback = null)
    {
        $this->generatorToArray();

        // If the key doesn't exist, set it.
        if (!$this->has($key)) {
            $this->array = $this->set($key, $fallback)->getArray();
        }

        return $this->get($key);
    }
public function setAndGet($key, $fallback = null)
    {
        $this->generatorToArray();

        // If the key doesn't exist, set it.
        if (!$this->has($key)) {
            $this->array = $this->set($key, $fallback)->getArray();
        }

        return $this->get($key);
    }
public function setAndGet ( $ key , $ fallback = null ) { $ this -> generatorToArray ( ) ; // If the key doesn't exist, set it. if ( ! $ this -> has ( $ key ) ) { $ this -> array = $ this -> set ( $ key , $ fallback ) -> getArray ( ) ; } return $ this -> get ( $ key ) ; }
Get a value from a array and set it if it was not.

WARNING: this method only set the value, if the $key is not already set

@param mixed $key      <p>The key</p>
@param mixed $fallback <p>The default value to set if it isn't.</p>

@return mixed
<p>(Mutable)</p>
Get a value from a array and set it if it was not .