/** * Save item into database and set to current config * * @param string $key * @param mixed $value * @param mixed $server * @param mixed $database * * @return void * * @throws Exceptions\SaveException */ public function store($key, $value, $server = null, $database = null) { // save key => value into DB $this->dbProvider->store($key, $value, $server, $database); //set value to config $this->origConfig->set($key, $value); }
/** * Save item into database and set to current config * * @param string $key * @param mixed $value * * @return void * * @throws Exceptions\SaveException */ public function store($key, $value) { // save key => value into DB $this->dbProvider->store($key, $value); //set value to config $this->origConfig->set($key, $value); }
/** * Save item into database and set to current config * * @param string $key * @param mixed $value * @param string $environment * * @return void * * @throws Exceptions\SaveException */ public function store($key, $value, $environment = null) { // Default to the current environment. if (is_null($environment)) { $environment = $this->environment; } list($namespace, $group, $item) = $this->origConfig->parseKey($key); if (is_null($item)) { throw new SaveException('The key should contain a group'); } $collection = $this->getCollection($group, $namespace); $dbkey = $collection . '.' . $item; // save key => value into DB $this->dbProvider->store($dbkey, $value, $environment); //set value to config $this->origConfig->set($key, $value); }