function MappingTest::filterNumericFields
Restricts the allowed fields to only numeric fields.
Parameters
array $fields: An array of field labels, keyed by the field ID.
File
-
core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ style/ MappingTest.php, line 58
Class
- MappingTest
- Provides a test plugin for the mapping style.
Namespace
Drupal\views_test_data\Plugin\views\styleCode
protected function filterNumericFields(&$fields) {
foreach ($this->view->field as $id => $field) {
if (!$field instanceof NumericField) {
unset($fields[$id]);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.