You are here

RedirectEvent.php in Redirect 403 to User Login 2.x

Same filename and directory in other branches
  1. 8 src/Event/RedirectEvent.php

File

src/Event/RedirectEvent.php
View source
<?php

namespace Drupal\r4032login\Event;

use Symfony\Component\EventDispatcher\Event;

/**
 * Event that is fired just before the redirection is perform.
 */
class RedirectEvent extends Event {
  const EVENT_NAME = 'r4032login.redirect';

  /**
   * The redirect url.
   *
   * @var string
   */
  private $url;

  /**
   * The redirect options.
   *
   * @var array
   */
  private $options;

  /**
   * Constructs the object.
   *
   * @param string $url
   *   The redirect url.
   * @param array $options
   *   The redirect options.
   */
  public function __construct($url, array $options) {
    $this->url = $url;
    $this->options = $options;
  }

  /**
   * Getter for url property.
   *
   * @return string
   *   The redirection url.
   */
  public function getUrl() {
    return $this->url;
  }

  /**
   * Setter for url property.
   *
   * @param string $url
   *   The url to redirect to.
   */
  public function setUrl($url) {
    $this->url = $url;
  }

  /**
   * Getter for options property.
   *
   * @return array
   *   The url redirection options.
   */
  public function getOptions() {
    return $this->options;
  }

  /**
   * Setter for options property.
   *
   * @param array $options
   *   The url options.
   */
  public function setOptions(array $options) {
    $this->options = $options;
  }

}

Classes

Namesort descending Description
RedirectEvent Event that is fired just before the redirection is perform.