public function update(string $id, array $cfg): int
  {
    return $this->db->update($this->class_cfg['table'], [
      $this->fields['text'] => $cfg[$this->fields['text']] ?? NULL,
      $this->fields['num'] => $cfg[$this->fields['num']] ?? NULL,
      $this->fields['id_link'] => $cfg[$this->fields['id_link']] ?? NULL,
      $this->fields['id_alias'] => $cfg[$this->fields['id_alias']] ?? NULL,
      $this->fields['id_user'] => $this->id_user,
      $this->fields['cfg'] => ($mp = $this->get_cfg(false, $cfg)) ? json_encode($tmp) : NULL
    ], [
      $this->fields['id'] => $id
    ]);
  }
public function update(string $id, array $cfg): int
  {
    return $this->db->update($this->class_cfg['table'], [
      $this->fields['text'] => $cfg[$this->fields['text']] ?? NULL,
      $this->fields['num'] => $cfg[$this->fields['num']] ?? NULL,
      $this->fields['id_link'] => $cfg[$this->fields['id_link']] ?? NULL,
      $this->fields['id_alias'] => $cfg[$this->fields['id_alias']] ?? NULL,
      $this->fields['id_user'] => $this->id_user,
      $this->fields['cfg'] => ($mp = $this->get_cfg(false, $cfg)) ? json_encode($tmp) : NULL
    ], [
      $this->fields['id'] => $id
    ]);
  }
public function update ( string $ id , array $ cfg ) : int { return $ this -> db -> update ( $ this -> class_cfg [ 'table' ] , [ $ this -> fields [ 'text' ] => $ cfg [ $ this -> fields [ 'text' ] ] ?? NULL , $ this -> fields [ 'num' ] => $ cfg [ $ this -> fields [ 'num' ] ] ?? NULL , $ this -> fields [ 'id_link' ] => $ cfg [ $ this -> fields [ 'id_link' ] ] ?? NULL , $ this -> fields [ 'id_alias' ] => $ cfg [ $ this -> fields [ 'id_alias' ] ] ?? NULL , $ this -> fields [ 'id_user' ] => $ this -> id_user , $ this -> fields [ 'cfg' ] => ( $ mp = $ this -> get_cfg ( false , $ cfg ) ) ? json_encode ( $ tmp ) : NULL ] , [ $ this -> fields [ 'id' ] => $ id ] ) ; }
Sets the permission row for the current user by the preference's ID

@param string $id
@param array $cfg
@return int
Sets the permission row for the current user by the preference s ID