You are here

class ImportEvent in Default Content for D8 8

Same name and namespace in other branches
  1. 2.0.x src/Event/ImportEvent.php \Drupal\default_content\Event\ImportEvent

Defines event fired when content is imported.

Hierarchy

  • class \Drupal\default_content\Event\ImportEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of ImportEvent

See also

\Drupal\default_content\Event\DefaultContentEvents

1 file declares its use of ImportEvent
Importer.php in src/Importer.php

File

src/Event/ImportEvent.php, line 12

Namespace

Drupal\default_content\Event
View source
class ImportEvent extends Event {

  /**
   * An array of content entities that were imported.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface[]
   */
  protected $entities;

  /**
   * The module that provides the default content.
   *
   * @var string
   */
  protected $module;

  /**
   * Constructs a new import event.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface[] $entities
   *   An array of content entities that were imported.
   * @param string $module
   *   The module that provided the default content.
   */
  public function __construct(array $entities, $module) {
    $this->entities = $entities;
    $this->module = $module;
  }

  /**
   * Get the imported entities.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface[]
   *   An array of content entities that were imported.
   */
  public function getImportedEntities() {
    return $this->entities;
  }

  /**
   * Gets the module name.
   *
   * @return string
   *   The module name that provided the default content.
   */
  public function getModule() {
    return $this->module;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ImportEvent::$entities protected property An array of content entities that were imported.
ImportEvent::$module protected property The module that provides the default content.
ImportEvent::getImportedEntities public function Get the imported entities.
ImportEvent::getModule public function Gets the module name.
ImportEvent::__construct public function Constructs a new import event.