private static function _get_table_where(string $table): ?string
  {
    if (
      bbn\str::check_name($table) &&
      ($db = self::_get_db()) &&
      ($databases_obj = self::_get_databases()) &&
      ($model = $databases_obj->modelize($table))
    ){
      $col = $db->escape('col');
      $where_ar = [];
      foreach ( $model['fields'] as $k => $f ){
        if ( !empty($f['id_option']) ){
          $where_ar[] = $col.' = UNHEX("'.$db->escape_value($f['id_option']).'")';
        }
      }
      if ( \count($where_ar) ){
        return implode(' OR ', $where_ar);
      }
    }
    return null;
  }
private static function _get_table_where(string $table): ?string
  {
    if (
      bbn\str::check_name($table) &&
      ($db = self::_get_db()) &&
      ($databases_obj = self::_get_databases()) &&
      ($model = $databases_obj->modelize($table))
    ){
      $col = $db->escape('col');
      $where_ar = [];
      foreach ( $model['fields'] as $k => $f ){
        if ( !empty($f['id_option']) ){
          $where_ar[] = $col.' = UNHEX("'.$db->escape_value($f['id_option']).'")';
        }
      }
      if ( \count($where_ar) ){
        return implode(' OR ', $where_ar);
      }
    }
    return null;
  }
private static function _get_table_where ( string $ table ) : ? string { if ( bbn \ str :: check_name ( $ table ) && ( $ db = self :: _get_db ( ) ) && ( $ databases_obj = self :: _get_databases ( ) ) && ( $ model = $ databases_obj -> modelize ( $ table ) ) ) { $ col = $ db -> escape ( 'col' ) ; $ where_ar = [ ] ; foreach ( $ model [ 'fields' ] as $ k => $ f ) { if ( ! empty ( $ f [ 'id_option' ] ) ) { $ where_ar [ ] = $ col . ' = UNHEX("' . $ db -> escape_value ( $ f [ 'id_option' ] ) . '")' ; } } if ( \ count ( $ where_ar ) ) { return implode ( ' OR ' , $ where_ar ) ; } } return null ; }
Get a string for the WHERE in the query with all the columns selection
@param string $table
@return string|null
Get a string for the WHERE in the query with all the columns selection