original_string: public function add($id_menu, array $cfg = null): ?string
    {
      $ids = [];
      if ( \is_array($id_menu) ){
        $cfg = $id_menu;
        $id_opt = $this->from_path('menus');      
      }
      if ( !empty($cfg) ){
        if ( \bbn\str::is_uid($id_menu) ){
          $id = $this->pref->add_bit($id_menu, $cfg);
        }
        else {
          $id = $this->pref->add($id_opt, $cfg);
        }
      }
      if ( !empty($id) ){
        if ( \bbn\str::is_uid($id_menu) ){
          $this->delete_cache($id_menu);
        }
        $this->options->delete_cache($id_opt);
        return $id;
      }
      return null;
    }
code: public function add($id_menu, array $cfg = null): ?string
    {
      $ids = [];
      if ( \is_array($id_menu) ){
        $cfg = $id_menu;
        $id_opt = $this->from_path('menus');      
      }
      if ( !empty($cfg) ){
        if ( \bbn\str::is_uid($id_menu) ){
          $id = $this->pref->add_bit($id_menu, $cfg);
        }
        else {
          $id = $this->pref->add($id_opt, $cfg);
        }
      }
      if ( !empty($id) ){
        if ( \bbn\str::is_uid($id_menu) ){
          $this->delete_cache($id_menu);
        }
        $this->options->delete_cache($id_opt);
        return $id;
      }
      return null;
    }
code_tokens: public function add ( $ id_menu , array $ cfg = null ) : ? string { $ ids = [ ] ; if ( \ is_array ( $ id_menu ) ) { $ cfg = $ id_menu ; $ id_opt = $ this -> from_path ( 'menus' ) ; } if ( ! empty ( $ cfg ) ) { if ( \ bbn \ str :: is_uid ( $ id_menu ) ) { $ id = $ this -> pref -> add_bit ( $ id_menu , $ cfg ) ; } else { $ id = $ this -> pref -> add ( $ id_opt , $ cfg ) ; } } if ( ! empty ( $ id ) ) { if ( \ bbn \ str :: is_uid ( $ id_menu ) ) { $ this -> delete_cache ( $ id_menu ) ; } $ this -> options -> delete_cache ( $ id_opt ) ; return $ id ; } return null ; }
docstring: Add menu and delete the chache.
  
  @param string|array $id_parent
  @param array $cfg
  @return null|string
  @internal param $id
docstring_tokens: Add menu and delete the chache .