class MissingContentEvent in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/Importer/MissingContentEvent.php \Drupal\Core\Config\Importer\MissingContentEvent
Wraps a configuration event for event listeners.
Hierarchy
- class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\Core\Config\Importer\MissingContentEvent
Expanded class hierarchy of MissingContentEvent
See also
\Drupal\Core\Config\ConfigEvents::IMPORT_MISSING_CONTENT
2 files declare their use of MissingContentEvent
- ConfigImporter.php in core/
lib/ Drupal/ Core/ Config/ ConfigImporter.php - EventSubscriber.php in core/
modules/ config/ tests/ config_import_test/ src/ EventSubscriber.php
File
- core/
lib/ Drupal/ Core/ Config/ Importer/ MissingContentEvent.php, line 12
Namespace
Drupal\Core\Config\ImporterView source
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MissingContentEvent:: |
protected | property | A list of missing content dependencies. | |
MissingContentEvent:: |
public | function | Gets missing content information. | |
MissingContentEvent:: |
public | function | Resolves the missing content by removing it from the list. | |
MissingContentEvent:: |
public | function | Constructs a configuration import missing content event object. |