original_string: protected function getFieldsCompare(array $products)
      {
          $labels = array();
  
          foreach ($products as $product) {
              if (!empty($product['field_value_labels'])) {
                  foreach ($product['field_value_labels'] as $type => $fields) {
                      foreach (array_keys($fields) as $field_id) {
                          $labels[$type][$field_id] = $product['fields'][$type][$field_id]['title'];
                      }
                  }
              }
          }
  
          return $labels;
      }
code: protected function getFieldsCompare(array $products)
      {
          $labels = array();
  
          foreach ($products as $product) {
              if (!empty($product['field_value_labels'])) {
                  foreach ($product['field_value_labels'] as $type => $fields) {
                      foreach (array_keys($fields) as $field_id) {
                          $labels[$type][$field_id] = $product['fields'][$type][$field_id]['title'];
                      }
                  }
              }
          }
  
          return $labels;
      }
code_tokens: protected function getFieldsCompare ( array $ products ) { $ labels = array ( ) ; foreach ( $ products as $ product ) { if ( ! empty ( $ product [ 'field_value_labels' ] ) ) { foreach ( $ product [ 'field_value_labels' ] as $ type => $ fields ) { foreach ( array_keys ( $ fields ) as $ field_id ) { $ labels [ $ type ] [ $ field_id ] = $ product [ 'fields' ] [ $ type ] [ $ field_id ] [ 'title' ] ; } } } } return $ labels ; }
docstring: Returns an array of all fields for the given products
  @param array $products
  @return array
docstring_tokens: Returns an array of all fields for the given products