DomainAccessFilter.php 581 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Drupal\domain_access\Plugin\views\filter;
  3. use Drupal\views\Plugin\views\filter\InOperator;
  4. /**
  5. * Provides filtering by assigned domain.
  6. *
  7. * @ViewsFilter("domain_access_filter")
  8. */
  9. class DomainAccessFilter extends InOperator {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function getValueOptions() {
  14. // @TODO: filter this list.
  15. if (!isset($this->valueOptions)) {
  16. $this->valueTitle = $this->t('Domains');
  17. $this->valueOptions = \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
  18. }
  19. return $this->valueOptions;
  20. }
  21. }