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
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
<?php
/**
* @file
* Contains \Drupal\Core\Config\MissingContentEvent.
*/
namespace Drupal\Core\Config\Importer;
use Symfony\Component\EventDispatcher\Event;
/**
* Wraps a configuration event for event listeners.
*
* @see \Drupal\Core\Config\Config\ConfigEvents::IMPORT_MISSING_CONTENT
*/
class MissingContentEvent extends Event {
/**
* A list of missing content dependencies.
*
* @var array
*/
protected $missingContent;
/**
* Constructs a configuration import missing content event object.
*
* @param array $missing_content
* Missing content information.
*/
public function __construct(array $missing_content) {
$this->missingContent = $missing_content;
}
/**
* Gets missing content information.
*
* @return array
* A list of missing content dependencies. The array is keyed by UUID. Each
* value is an array with the following keys: 'entity_type', 'bundle' and
* 'uuid'.
*/
public function getMissingContent() {
return $this->missingContent;
}
/**
* Resolves the missing content by removing it from the list.
*
* @param string $uuid
* The UUID of the content entity to mark resolved.
*
* @return $this
* The MissingContentEvent object.
*/
public function resolveMissingContent($uuid) {
if (isset($this->missingContent[$uuid])) {
unset($this->missingContent[$uuid]);
}
return $this;
}
}