DomainAccessArgument.php 508 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Drupal\domain_access\Plugin\views\argument;
  3. use Drupal\views\Plugin\views\argument\StringArgument;
  4. /**
  5. * Argument handler to find nodes by domain assignment.
  6. *
  7. * @ViewsArgument("domain_access_argument")
  8. */
  9. class DomainAccessArgument extends StringArgument {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function title() {
  14. if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($this->argument)) {
  15. return $domain->label();
  16. }
  17. return parent::title();
  18. }
  19. }