e36c41884b6653068aa815e5d03dd8449ffe3380
[yaffs-website] / web / core / modules / config_translation / src / Event / ConfigMapperPopulateEvent.php
1 <?php
2
3 namespace Drupal\config_translation\Event;
4
5 use Drupal\config_translation\ConfigMapperInterface;
6 use Drupal\Core\Routing\RouteMatchInterface;
7 use Symfony\Component\EventDispatcher\Event;
8
9 /**
10  * Provides a class for events related to configuration translation mappers.
11  */
12 class ConfigMapperPopulateEvent extends Event {
13
14   /**
15    * The configuration mapper this event is related to.
16    *
17    * @var \Drupal\config_translation\ConfigMapperInterface
18    */
19   protected $mapper;
20
21   /**
22    * The route match this event is related to.
23    *
24    * @var \Drupal\Core\Routing\RouteMatchInterface
25    */
26   protected $routeMatch;
27
28   /**
29    * Constructs a ConfigMapperPopulateEvent object.
30    *
31    * @param \Drupal\config_translation\ConfigMapperInterface $mapper
32    *   The configuration mapper this event is related to.
33    * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
34    *   The route match this event is related to.
35    */
36   public function __construct(ConfigMapperInterface $mapper, RouteMatchInterface $route_match) {
37     $this->mapper = $mapper;
38     $this->routeMatch = $route_match;
39   }
40
41   /**
42    * Gets the configuration mapper this event is related to.
43    *
44    * @return \Drupal\config_translation\ConfigMapperInterface
45    *   The configuration mapper this event is related to.
46    */
47   public function getMapper() {
48     return $this->mapper;
49   }
50
51   /**
52    * Gets the route match this event is related to.
53    *
54    * @return \Drupal\Core\Routing\RouteMatchInterface
55    *   The route match this event is related to.
56    */
57   public function getRouteMatch() {
58     return $this->routeMatch;
59   }
60
61 }