You are here

public function PriceCalculatedFormatter::__construct in Price 2.0.x

Constructs a new PriceCalculatedFormatter object.

Parameters

string $plugin_id: The plugin_id for the formatter.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the formatter is associated.

array $settings: The formatter settings.

string $label: The formatter label display setting.

string $view_mode: The view mode.

array $third_party_settings: Any third party settings settings.

\CommerceGuys\Intl\Formatter\CurrencyFormatterInterface $currency_formatter: The currency formatter.

\Drupal\price\Resolver\ChainPriceResolverInterface $chain_price_resolver: The chain price resolver.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

Overrides PriceDefaultFormatter::__construct

File

src/Plugin/Field/FieldFormatter/PriceCalculatedFormatter.php, line 68

Class

PriceCalculatedFormatter
Plugin implementation of the 'price_calculated' formatter.

Namespace

Drupal\price\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, CurrencyFormatterInterface $currency_formatter, ChainPriceResolverInterface $chain_price_resolver, AccountInterface $current_user) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $currency_formatter);
  $this->chainPriceResolver = $chain_price_resolver;
  $this->currentUser = $current_user;
}