src/bbn/user/preferences.php
public function move_bit(string $id, string $id_parent = null): ?bool
  { 
    if ( 
      \bbn\str::is_uid($id) && 
      (
        (\bbn\str::is_uid($id_parent) && $this->get_bit($id_parent)) || 
        \is_null($id_parent)
      ) &&
      ($bit = $this->get_bit($id)) &&
      ($cf = $this->get_class_cfg()) &&
      ($cfg =  $cf['arch']['user_options_bits'])
    ){
      $upd = [
        $cfg['id_parent'] => $id_parent,
        $cfg['num'] => $this->get_max_bit_num($bit[$cfg['id_user_option']], $id_parent, true)
      ];
      return !!$this->db->update($cf['tables']['user_options_bits'], $upd, [$cfg['id'] => $id]);
    }
    return null;
  }
public function move_bit(string $id, string $id_parent = null): ?bool
  { 
    if ( 
      \bbn\str::is_uid($id) && 
      (
        (\bbn\str::is_uid($id_parent) && $this->get_bit($id_parent)) || 
        \is_null($id_parent)
      ) &&
      ($bit = $this->get_bit($id)) &&
      ($cf = $this->get_class_cfg()) &&
      ($cfg =  $cf['arch']['user_options_bits'])
    ){
      $upd = [
        $cfg['id_parent'] => $id_parent,
        $cfg['num'] => $this->get_max_bit_num($bit[$cfg['id_user_option']], $id_parent, true)
      ];
      return !!$this->db->update($cf['tables']['user_options_bits'], $upd, [$cfg['id'] => $id]);
    }
    return null;
  }
public function move_bit ( string $ id , string $ id_parent = null ) : ? bool { if ( \ bbn \ str :: is_uid ( $ id ) && ( ( \ bbn \ str :: is_uid ( $ id_parent ) && $ this -> get_bit ( $ id_parent ) ) || \ is_null ( $ id_parent ) ) && ( $ bit = $ this -> get_bit ( $ id ) ) && ( $ cf = $ this -> get_class_cfg ( ) ) && ( $ cfg = $ cf [ 'arch' ] [ 'user_options_bits' ] ) ) { $ upd = [ $ cfg [ 'id_parent' ] => $ id_parent , $ cfg [ 'num' ] => $ this -> get_max_bit_num ( $ bit [ $ cfg [ 'id_user_option' ] ] , $ id_parent , true ) ] ; return ! ! $ this -> db -> update ( $ cf [ 'tables' ] [ 'user_options_bits' ] , $ upd , [ $ cfg [ 'id' ] => $ id ] ) ; } return null ; }
Moves a bit.

@param string $id The bit's ID
@param string|null The new parent's ID
@return bool|null
Moves a bit .