Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FinalMissingContentSubscriber.php

class FinalMissingContentSubscriber

Final event subscriber to the missing content event.

Ensure that all missing content dependencies are removed from the event so the importer can complete.

Hierarchy

  • class \Drupal\Core\Config\Importer\FinalMissingContentSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of FinalMissingContentSubscriber

See also

\Drupal\Core\Config\ConfigImporter::processMissingContent()

File

core/lib/Drupal/Core/Config/Importer/FinalMissingContentSubscriber.php, line 16

Namespace

Drupal\Core\Config\Importer
View source
class FinalMissingContentSubscriber implements EventSubscriberInterface {
    
    /**
     * Handles the missing content event.
     *
     * @param \Drupal\Core\Config\Importer\MissingContentEvent $event
     *   The missing content event.
     */
    public function onMissingContent(MissingContentEvent $event) {
        foreach (array_keys($event->getMissingContent()) as $uuid) {
            $event->resolveMissingContent($uuid);
        }
    }
    
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() : array {
        // This should always be the final event as it will mark all content
        // dependencies as resolved.
        $events[ConfigEvents::IMPORT_MISSING_CONTENT][] = [
            'onMissingContent',
            -1024,
        ];
        return $events;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
FinalMissingContentSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents
FinalMissingContentSubscriber::onMissingContent public function Handles the missing content event.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal