ConfigRevertEvent.php
1.5 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Contains \Drupal\config_update\ConfigRevertEvent.
*/
namespace Drupal\config_update;
use Symfony\Component\EventDispatcher\Event;
/**
* Event context class for configuration revert/import events.
*
* This class is passed in as the event when the
* \Drupal\config_update\ConfigRevertInterface::IMPORT and
* \Drupal\config_update\ConfigRevertInterface::REVERT events are triggered.
*/
class ConfigRevertEvent extends Event {
/**
* The type of configuration that is being imported or reverted.
*
* @var string
*/
protected $type;
/**
* The name of the config item being imported or reverted, without prefix.
*
* @var string
*/
protected $name;
/**
* Constructs a new ConfigRevertEvent.
*
* @param string $type
* The type of configuration being imported or reverted.
* @param string $name
* The name of the config item being imported/reverted, without prefix.
*/
function __construct($type, $name) {
$this->type = $type;
$this->name = $name;
}
/**
* Returns the type of configuration being imported or reverted.
*
* @return string
* The type of configuration, either 'system.simple' or a config entity
* type machine name.
*/
public function getType() {
return $this->type;
}
/**
* Returns the name of the config item, without prefix.
*
* @return string
* The name of the config item being imported/reverted, with the prefix.
*/
public function getName() {
return $this->name;
}
}