original_string: public function set(string $id, array $cfg = null): int
    {
      return $this->db->update($this->class_cfg['table'], [
        $this->fields['cfg'] => $cfg ? json_encode($this->get_cfg(false, $cfg)) : null
      ], [
        $this->fields['id'] => $id
      ]);
    }
code: public function set(string $id, array $cfg = null): int
    {
      return $this->db->update($this->class_cfg['table'], [
        $this->fields['cfg'] => $cfg ? json_encode($this->get_cfg(false, $cfg)) : null
      ], [
        $this->fields['id'] => $id
      ]);
    }
code_tokens: public function set ( string $ id , array $ cfg = null ) : int { return $ this -> db -> update ( $ this -> class_cfg [ 'table' ] , [ $ this -> fields [ 'cfg' ] => $ cfg ? json_encode ( $ this -> get_cfg ( false , $ cfg ) ) : null ] , [ $ this -> fields [ 'id' ] => $ id ] ) ; }
docstring: Sets the permission config for the current user by the preference's ID
  
  @param string $id
  @param array $cfg
  @return int
docstring_tokens: Sets the permission config for the current user by the preference s ID