You are here

ComputedDecimalFormatter.php in Computed Field 8.2

Same filename and directory in other branches
  1. 3.x src/Plugin/Field/FieldFormatter/ComputedDecimalFormatter.php

File

src/Plugin/Field/FieldFormatter/ComputedDecimalFormatter.php
View source
<?php

namespace Drupal\computed_field\Plugin\Field\FieldFormatter;

use Drupal\Core\Field\Plugin\Field\FieldFormatter\DecimalFormatter;

/**
 * Plugin implementation of the 'Default' formatter for computed decimals.
 *
 * @FieldFormatter(
 *   id = "computed_decimal",
 *   label = @Translation("Default"),
 *   field_types = {
 *     "computed_decimal",
 *     "computed_float"
 *   }
 * )
 */
class ComputedDecimalFormatter extends DecimalFormatter {

  /**
   * Include default formatting for cache settings.
   * Implements:
   *    defaultSettings()
   *    settingsForm(...)
   *    settingsSummary()
   */
  use ComputedCacheFormatterTrait;

  /**
   * Include formatting for numeric fields.
   * Implements:
   *    viewElements(...)
   */
  use ComputedNumericFormatterTrait;

}

Classes

Namesort descending Description
ComputedDecimalFormatter Plugin implementation of the 'Default' formatter for computed decimals.