public function set($key, $value)
    {
        if (!is_null($key)
            && is_scalar($key)
        ) {
            return $this->_items[$key] = $value;
        } else {
            // given index name is not valid
            throw new EnumeratorException('Element could not be added to list. Index is not valid.', E_NOTICE);
        }
    }
public function set($key, $value)
    {
        if (!is_null($key)
            && is_scalar($key)
        ) {
            return $this->_items[$key] = $value;
        } else {
            // given index name is not valid
            throw new EnumeratorException('Element could not be added to list. Index is not valid.', E_NOTICE);
        }
    }
public function set ( $ key , $ value ) { if ( ! is_null ( $ key ) && is_scalar ( $ key ) ) { return $ this -> _items [ $ key ] = $ value ; } else { // given index name is not valid throw new EnumeratorException ( 'Element could not be added to list. Index is not valid.' , E_NOTICE ) ; } }
add or replace a value with a specified key

@param    mixed      $key        key
@param    mixed      $value      value
@return   mixed                  value
@throws   EnumeratorException
add or replace a value with a specified key