protected function CommerceEntityViewsData::processViewsDataForAddressCountry in Commerce Core 8.2
Corrects the views data for address_country base fields.
Based on address_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 335
Class
- CommerceEntityViewsData
- Provides improvements to core's generic views integration for entities.
Namespace
Drupal\commerceCode
protected function processViewsDataForAddressCountry($table, FieldDefinitionInterface $field_definition, array &$views_field, $field_column_name) {
if ($field_column_name == 'value') {
$views_field['field'] = [
'id' => 'country',
'field_name' => $field_definition
->getName(),
'property' => 'value',
];
$views_field['filter']['id'] = 'country';
$views_field['sort']['id'] = 'country';
}
}