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

Breadcrumb

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

class MissingContentEvent

Wraps a configuration event for event listeners.

Hierarchy

  • class \Symfony\Contracts\EventDispatcher\Event implements \Psr\EventDispatcher\StoppableEventInterface
    • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Contracts\EventDispatcher\Event
      • class \Drupal\Core\Config\Importer\MissingContentEvent extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of MissingContentEvent

See also

\Drupal\Core\Config\ConfigEvents::IMPORT_MISSING_CONTENT

1 file declares its use of MissingContentEvent
ConfigImporter.php in core/lib/Drupal/Core/Config/ConfigImporter.php

File

core/lib/Drupal/Core/Config/Importer/MissingContentEvent.php, line 12

Namespace

Drupal\Core\Config\Importer
View 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

Title Sort descending Modifiers Object type Summary
MissingContentEvent::$missingContent protected property A list of missing content dependencies.
MissingContentEvent::getMissingContent public function Gets missing content information.
MissingContentEvent::resolveMissingContent public function Resolves the missing content by removing it from the list.
MissingContentEvent::__construct public function Constructs a configuration import missing content event object.

API Navigation

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