public function store($key = '', $value = array(), $lock = true)
  {
    if ($key == '') {
      $this->fault('[Error] Cannot store data without a key. Key is "' . $key . '".');
    }

    if (!$this->has_key($key)) {
      $this->create($key, $lock);
      $this->store_data($key, $value);
    } else {
      if (!$this->is_locked($key)) {
        $this->store_data($key, $value);
      } else {
        $this->fault('[Error] Cannot store data with a registered key that is locked.');
      }
    }
  }
public function store($key = '', $value = array(), $lock = true)
  {
    if ($key == '') {
      $this->fault('[Error] Cannot store data without a key. Key is "' . $key . '".');
    }

    if (!$this->has_key($key)) {
      $this->create($key, $lock);
      $this->store_data($key, $value);
    } else {
      if (!$this->is_locked($key)) {
        $this->store_data($key, $value);
      } else {
        $this->fault('[Error] Cannot store data with a registered key that is locked.');
      }
    }
  }
public function store ( $ key = '' , $ value = array ( ) , $ lock = true ) { if ( $ key == '' ) { $ this -> fault ( '[Error] Cannot store data without a key. Key is "' . $ key . '".' ) ; } if ( ! $ this -> has_key ( $ key ) ) { $ this -> create ( $ key , $ lock ) ; $ this -> store_data ( $ key , $ value ) ; } else { if ( ! $ this -> is_locked ( $ key ) ) { $ this -> store_data ( $ key , $ value ) ; } else { $ this -> fault ( '[Error] Cannot store data with a registered key that is locked.' ) ; } } }
Saves some data by key value.
@param $key string | The key name.
@param $value any | The value.
Saves some data by key value .