You are here

class ExternalHreflangGetCurrentUrlEvent in External Hreflang 8

Class to get Current Url.

@package Drupal\external_hreflang\Event

Hierarchy

Expanded class hierarchy of ExternalHreflangGetCurrentUrlEvent

2 files declare their use of ExternalHreflangGetCurrentUrlEvent
ExternalHreflangGetCurrentUrlEventSubscriber.php in src/EventSubscriber/ExternalHreflangGetCurrentUrlEventSubscriber.php
external_hreflang.tokens.inc in ./external_hreflang.tokens.inc
Token related functions for the external_hreflang.

File

src/Event/ExternalHreflangGetCurrentUrlEvent.php, line 13

Namespace

Drupal\external_hreflang\Event
View source
class ExternalHreflangGetCurrentUrlEvent extends Event {
  const EVENT_NAME = 'external_hreflang_get_current_url';

  /**
   * Url object.
   *
   * @var \Drupal\Core\Url
   */
  private $url;

  /**
   * Get the current url object.
   *
   * @return \Drupal\Core\Url
   *   URL object.
   */
  public function getCurrentUrl() {
    return $this->url;
  }

  /**
   * Set the current url object.
   *
   * @param \Drupal\Core\Url $url
   *   URL object.
   */
  public function setCurrentUrl(Url $url) {
    $url
      ->setAbsolute(FALSE);
    $this->url = $url;
  }

}

Members