You are here

protected function CommerceEntityViewsData::processViewsDataForCommercePrice in Commerce Core 8.2

Corrects the views data for commerce_price base fields.

Based on commerce_price_field_views_data().

Parameters

string $table: The table name.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.

array $views_field: The views field data.

string $field_column_name: The field column being processed.

File

src/CommerceEntityViewsData.php, line 361

Class

CommerceEntityViewsData
Provides improvements to core's generic views integration for entities.

Namespace

Drupal\commerce

Code

protected function processViewsDataForCommercePrice($table, FieldDefinitionInterface $field_definition, array &$views_field, $field_column_name) {
  if ($field_column_name == 'number') {
    $views_field['filter']['id'] = 'numeric';
  }
  elseif ($field_column_name == 'currency_code') {
    $views_field['filter']['id'] = 'commerce_currency';
  }
}