You are here

class AlterExcludedPathsEvent in Stage File Proxy 8

Class AlterExcludedPathsEvent.

@package Drupal\stage_file_proxy\EventDispatcher

Hierarchy

  • class \Drupal\stage_file_proxy\EventDispatcher\AlterExcludedPathsEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of AlterExcludedPathsEvent

1 file declares its use of AlterExcludedPathsEvent
ProxySubscriber.php in src/EventSubscriber/ProxySubscriber.php

File

src/EventDispatcher/AlterExcludedPathsEvent.php, line 12

Namespace

Drupal\stage_file_proxy\EventDispatcher
View source
class AlterExcludedPathsEvent extends Event {

  /**
   * The array with paths to exclude.
   *
   * @var array
   */
  protected $excludedPaths;

  /**
   * Constructor.
   *
   * @param array $excluded_paths
   *   The excluded paths array.
   */
  public function __construct(array $excluded_paths) {
    $this
      ->setExcludedPaths($excluded_paths);
  }

  /**
   * Getter for the excluded paths array.
   *
   * @return array
   *   The excluded paths array.
   */
  public function getExcludedPaths() {
    return $this->excludedPaths;
  }

  /**
   * Setter for the excluded paths array.
   *
   * @param array $excluded_paths
   *   The excluded paths array to set.
   */
  public function setExcludedPaths(array $excluded_paths) {
    $this->excludedPaths = $excluded_paths;
  }

  /**
   * Adds an excluded path to the excluded paths array.
   *
   * @param string $excluded_path
   *   The excluded path string to add.
   */
  public function addExcludedPath($excluded_path) {
    $this->excludedPaths[] = $excluded_path;
  }

  /**
   * Adds an excluded path to the excluded paths array.
   *
   * @param string $excluded_path
   *   The excluded path string to add.
   */
  public function removeExcludedPath($excluded_path) {
    foreach (array_keys($this->excludedPaths, $excluded_path) as $key) {
      unset($this->excludedPaths[$key]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AlterExcludedPathsEvent::$excludedPaths protected property The array with paths to exclude.
AlterExcludedPathsEvent::addExcludedPath public function Adds an excluded path to the excluded paths array.
AlterExcludedPathsEvent::getExcludedPaths public function Getter for the excluded paths array.
AlterExcludedPathsEvent::removeExcludedPath public function Adds an excluded path to the excluded paths array.
AlterExcludedPathsEvent::setExcludedPaths public function Setter for the excluded paths array.
AlterExcludedPathsEvent::__construct public function Constructor.