You are here

protected function NumericField::defineOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/NumericField.php \Drupal\views\Plugin\views\field\NumericField::defineOptions()
  2. 10 core/modules/views/src/Plugin/views/field/NumericField.php \Drupal\views\Plugin\views\field\NumericField::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides FieldPluginBase::defineOptions

1 call to NumericField::defineOptions()
NodeNewComments::defineOptions in core/modules/comment/src/Plugin/views/field/NodeNewComments.php
Information about options for all kinds of purposes will be held here.
1 method overrides NumericField::defineOptions()
NodeNewComments::defineOptions in core/modules/comment/src/Plugin/views/field/NodeNewComments.php
Information about options for all kinds of purposes will be held here.

File

core/modules/views/src/Plugin/views/field/NumericField.php, line 26

Class

NumericField
Render a field as a numeric value.

Namespace

Drupal\views\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['set_precision'] = [
    'default' => FALSE,
  ];
  $options['precision'] = [
    'default' => 0,
  ];
  $options['decimal'] = [
    'default' => '.',
  ];
  $options['separator'] = [
    'default' => ',',
  ];
  $options['format_plural'] = [
    'default' => FALSE,
  ];
  $options['format_plural_string'] = [
    'default' => '1' . PoItem::DELIMITER . '@count',
  ];
  $options['prefix'] = [
    'default' => '',
  ];
  $options['suffix'] = [
    'default' => '',
  ];
  return $options;
}