Currency.php in Currency 8.3
File
src/Plugin/views/filter/Currency.php
View source
<?php
namespace Drupal\currency\Plugin\views\filter;
use Drupal\currency\Entity\Currency as CurrencyEntity;
use Drupal\currency\FormHelperInterface;
use Drupal\views\Plugin\views\filter\InOperator;
use Symfony\Component\DependencyInjection\ContainerInterface;
class Currency extends InOperator {
protected $formHelper;
public function __construct(array $configuration, $plugin_id, $plugin_definition, FormHelperInterface $form_helper) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->formHelper = $form_helper;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('currency.form_helper'));
}
function getValueOptions() {
if (is_null($this->valueOptions)) {
$this->valueOptions = $this->formHelper
->getCurrencyOptions();
}
return $this->valueOptions;
}
}
Classes
Name |
Description |
Currency |
A Views filter handler to filter currencies by ISO 4217 code. |