You are here

public function PriceCalculatedFormatter::__construct in Commerce Core 8.2

Same name in this branch
  1. 8.2 modules/price/src/Plugin/Field/FieldFormatter/PriceCalculatedFormatter.php \Drupal\commerce_price\Plugin\Field\FieldFormatter\PriceCalculatedFormatter::__construct()
  2. 8.2 modules/order/src/Plugin/Field/FieldFormatter/PriceCalculatedFormatter.php \Drupal\commerce_order\Plugin\Field\FieldFormatter\PriceCalculatedFormatter::__construct()

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\commerce_price\Resolver\ChainPriceResolverInterface $chain_price_resolver: The chain price resolver.

\Drupal\commerce_store\CurrentStoreInterface $current_store: The current store.

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

Overrides PriceDefaultFormatter::__construct

File

modules/price/src/Plugin/Field/FieldFormatter/PriceCalculatedFormatter.php, line 78

Class

PriceCalculatedFormatter
Plugin implementation of the 'commerce_price_calculated' formatter.

Namespace

Drupal\commerce_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, CurrentStoreInterface $current_store, 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->currentStore = $current_store;
  $this->currentUser = $current_user;
}