method update documentation in bbn\User\Preferences

Sets the preference row for the current user by the preference's ID and returns the number of rows change.

Example

pref->update('106fc38f2b7f11eca47652540000cfbe', [ "num" => null, "id_user" => "5d02d5ee269d11eca47652540000cfbe", "id_alias" => null, "id_link" => null, "text" => "Nextcloud" ]); // (int) = 1; function(string $id, array $cfg) { 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'] => ($tmp = $this->getCfg(false, $cfg)) ? json_encode($tmp) : null ], [ $this->fields['id'] => $id ] ); }

Sets the preference row for the current user by the preference's ID and returns the number of rows change. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.