You are here

class MissingContentEvent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/Importer/MissingContentEvent.php \Drupal\Core\Config\Importer\MissingContentEvent

Wraps a configuration event for event listeners.

Hierarchy

Expanded class hierarchy of MissingContentEvent

See also

\Drupal\Core\Config\Config\ConfigEvents::IMPORT_MISSING_CONTENT

2 files declare their use of MissingContentEvent
ConfigImporter.php in core/lib/Drupal/Core/Config/ConfigImporter.php
Contains \Drupal\Core\Config\ConfigImporter.
EventSubscriber.php in core/modules/config/tests/config_import_test/src/EventSubscriber.php
Contains \Drupal\config_import_test\EventSubscriber.

File

core/lib/Drupal/Core/Config/Importer/MissingContentEvent.php, line 17
Contains \Drupal\Core\Config\Importer\MissingContentEvent.

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

Namesort descending Modifiers Type Description Overrides
Event::$dispatcher private property
Event::$name private property
Event::$propagationStopped private property
Event::getDispatcher Deprecated public function Returns the EventDispatcher that dispatches this Event.
Event::getName Deprecated public function Gets the event's name.
Event::isPropagationStopped public function Returns whether further event listeners should be triggered.
Event::setDispatcher Deprecated public function Stores the EventDispatcher that dispatches this Event.
Event::setName Deprecated public function Sets the event's name property.
Event::stopPropagation public function Stops the propagation of the event to further event listeners.
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.