protected function Numeric::defineOptions

Same name in this branch
  1. 9.x drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/Numeric.php \Drupal\views\Plugin\views\field\Numeric::defineOptions()
  2. 9.x drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/Numeric.php \Drupal\views\Plugin\views\argument\Numeric::defineOptions()
  3. 9.x drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php \Drupal\views\Plugin\views\filter\Numeric::defineOptions()

Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • '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().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.

),

Return value

array Returns the options of this handler/plugin.

Overrides FieldPluginBase::defineOptions

2 calls to Numeric::defineOptions()
NodeNewComments::defineOptions in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Score::defineOptions in drupal/core/modules/search/lib/Drupal/search/Plugin/views/field/Score.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
2 methods override Numeric::defineOptions()
NodeNewComments::defineOptions in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Score::defineOptions in drupal/core/modules/search/lib/Drupal/search/Plugin/views/field/Score.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/Numeric.php, line 27
Definition of Drupal\views\Plugin\views\field\Numeric.

Class

Numeric
Render a field as a numeric value

Namespace

Drupal\views\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['set_precision'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['precision'] = array(
    'default' => 0,
  );
  $options['decimal'] = array(
    'default' => '.',
    'translatable' => TRUE,
  );
  $options['separator'] = array(
    'default' => ',',
    'translatable' => TRUE,
  );
  $options['format_plural'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['format_plural_singular'] = array(
    'default' => '1',
  );
  $options['format_plural_plural'] = array(
    'default' => '@count',
  );
  $options['prefix'] = array(
    'default' => '',
    'translatable' => TRUE,
  );
  $options['suffix'] = array(
    'default' => '',
    'translatable' => TRUE,
  );
  return $options;
}