You are here

class FixedRatesOperationsProvider in Currency 8.3

Provides operations for the fixed rates exchange rate provider.

Hierarchy

Expanded class hierarchy of FixedRatesOperationsProvider

1 file declares its use of FixedRatesOperationsProvider
FixedRatesOperationsProviderTest.php in tests/src/Unit/Plugin/Currency/ExchangeRateProvider/FixedRatesOperationsProviderTest.php

File

src/Plugin/Currency/ExchangeRateProvider/FixedRatesOperationsProvider.php, line 16

Namespace

Drupal\currency\Plugin\Currency\ExchangeRateProvider
View source
class FixedRatesOperationsProvider implements PluginOperationsProviderInterface, ContainerInjectionInterface {
  use StringTranslationTrait;

  /**
   * The redirect destination.
   *
   * @var \Drupal\Core\Routing\RedirectDestinationInterface
   */
  protected $redirectDestination;

  /**
   * Constructs a new instance.
   *
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The string translator.
   * @param \Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination
   *   The redirect destination.
   */
  public function __construct(TranslationInterface $string_translation, RedirectDestinationInterface $redirect_destination) {
    $this->redirectDestination = $redirect_destination;
    $this->stringTranslation = $string_translation;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('string_translation'), $container
      ->get('redirect.destination'));
  }

  /**
   * {@inheritdoc}
   */
  public function getOperations($plugin_id) {
    $operations['configure'] = array(
      'title' => $this
        ->t('Configure'),
      'query' => $this->redirectDestination
        ->getAsArray(),
      'url' => new Url('currency.exchange_rate_provider.fixed_rates.overview'),
    );
    return $operations;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FixedRatesOperationsProvider::$redirectDestination protected property The redirect destination.
FixedRatesOperationsProvider::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
FixedRatesOperationsProvider::getOperations public function Gets plugin operations. Overrides PluginOperationsProviderInterface::getOperations
FixedRatesOperationsProvider::__construct public function Constructs a new instance.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.