original_string: protected function filterValues($table, array $data)
      {
          $scheme = $this->getScheme($table);
          $values = array_intersect_key($data, $scheme['fields']);
  
          if (empty($values)) {
              return array();
          }
  
          foreach ($values as $field => &$value) {
  
              if (!empty($scheme['fields'][$field]['auto_increment'])) {
                  unset($values[$field]);
                  continue;
              }
  
              if (is_null($value) && !empty($scheme['fields'][$field]['not_null'])) {
                  unset($values[$field]);
                  continue;
              }
  
              if (!empty($scheme['fields'][$field]['serialize'])) {
                  if (!is_array($value)) {
                      $value = array();
                  }
                  $value = serialize($value);
              }
          }
  
          return $values;
      }
code: protected function filterValues($table, array $data)
      {
          $scheme = $this->getScheme($table);
          $values = array_intersect_key($data, $scheme['fields']);
  
          if (empty($values)) {
              return array();
          }
  
          foreach ($values as $field => &$value) {
  
              if (!empty($scheme['fields'][$field]['auto_increment'])) {
                  unset($values[$field]);
                  continue;
              }
  
              if (is_null($value) && !empty($scheme['fields'][$field]['not_null'])) {
                  unset($values[$field]);
                  continue;
              }
  
              if (!empty($scheme['fields'][$field]['serialize'])) {
                  if (!is_array($value)) {
                      $value = array();
                  }
                  $value = serialize($value);
              }
          }
  
          return $values;
      }
code_tokens: protected function filterValues ( $ table , array $ data ) { $ scheme = $ this -> getScheme ( $ table ) ; $ values = array_intersect_key ( $ data , $ scheme [ 'fields' ] ) ; if ( empty ( $ values ) ) { return array ( ) ; } foreach ( $ values as $ field => & $ value ) { if ( ! empty ( $ scheme [ 'fields' ] [ $ field ] [ 'auto_increment' ] ) ) { unset ( $ values [ $ field ] ) ; continue ; } if ( is_null ( $ value ) && ! empty ( $ scheme [ 'fields' ] [ $ field ] [ 'not_null' ] ) ) { unset ( $ values [ $ field ] ) ; continue ; } if ( ! empty ( $ scheme [ 'fields' ] [ $ field ] [ 'serialize' ] ) ) { if ( ! is_array ( $ value ) ) { $ value = array ( ) ; } $ value = serialize ( $ value ) ; } } return $ values ; }
docstring: Filters an array of data according to existing scheme for the given table
  @param string $table
  @param array $data
  @return array
docstring_tokens: Filters an array of data according to existing scheme for the given table