RouteBuildEvent.php 1006 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?php

/**
 * @file
 * Definition of Drupal\Core\Routing\RouteBuildEvent.
 */

namespace Drupal\Core\Routing;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Routing\RouteCollection;

/**
 * Represents route building information as event.
 */
class RouteBuildEvent extends Event {

  /**
   * The route collection.
   *
   * @var \Symfony\Component\Routing\RouteCollection
   */
  protected $routeCollection;

  /**
26
   * The provider of this route collection.
27 28 29
   *
   * @var string
   */
30
  protected $provider;
31 32 33 34

  /**
   * Constructs a RouteBuildEvent object.
   */
35
  public function __construct(RouteCollection $route_collection, $provider) {
36
    $this->routeCollection = $route_collection;
37
    $this->provider = $provider;
38 39 40 41 42 43 44 45 46 47
  }

  /**
   * Gets the route collection.
   */
  public function getRouteCollection() {
    return $this->routeCollection;
  }

  /**
48
   * Gets the provider for this route collection.
49
   */
50 51
  public function getProvider() {
    return $this->provider;
52 53 54
  }

}