public function update($data)
    {
        $validator = new StringValidator();
        $validator->max = 255;

        foreach ($data as $key => $value) {
            if (!in_array($key, $this->readonly) && array_key_exists($key, $this->settings)) {
                if (!$validator->validate($value)) {
                    return false;
                }
                if (!$this->config->set($key, $value)) {
                    return false;
                }
            }
        }
        return true;
    }
public function update($data)
    {
        $validator = new StringValidator();
        $validator->max = 255;

        foreach ($data as $key => $value) {
            if (!in_array($key, $this->readonly) && array_key_exists($key, $this->settings)) {
                if (!$validator->validate($value)) {
                    return false;
                }
                if (!$this->config->set($key, $value)) {
                    return false;
                }
            }
        }
        return true;
    }
public function update ( $ data ) { $ validator = new StringValidator ( ) ; $ validator -> max = 255 ; foreach ( $ data as $ key => $ value ) { if ( ! in_array ( $ key , $ this -> readonly ) && array_key_exists ( $ key , $ this -> settings ) ) { if ( ! $ validator -> validate ( $ value ) ) { return false ; } if ( ! $ this -> config -> set ( $ key , $ value ) ) { return false ; } } } return true ; }
Updates the value of setting.
@param string[] $data
@return bool
Updates the value of setting .