You are here

class PostImportEvent in YAML Content 8.2

Wraps a yaml content post-import event for event listeners.

Hierarchy

  • class \Drupal\yaml_content\Event\EventBase extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of PostImportEvent

1 file declares its use of PostImportEvent
ContentLoaderBase.php in src/ContentLoader/ContentLoaderBase.php

File

src/Event/PostImportEvent.php, line 10

Namespace

Drupal\yaml_content\Event
View source
class PostImportEvent extends EventBase {

  /**
   * The list of content files imported in the completed batch.
   *
   * @var array
   */
  protected $importFiles;

  /**
   * An associative array of imported content entities keyed by file name.
   *
   * @var array
   */
  protected $loadedContent;

  /**
   * Constructs a yaml content post-import event object.
   *
   * @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
   *   The active Content Loader that triggered the event.
   * @param array $import_files
   *   An array of files imported in the completed batch.
   * @param array $loaded_content
   *   An associative array of imported content entities keyed by file name.
   */
  public function __construct(ContentLoaderInterface $loader, array $import_files, array $loaded_content) {
    parent::__construct($loader);
    $this->importFiles = $import_files;
  }

  /**
   * Gets the list of files imported in the completed batch.
   *
   * @return array
   *   The list of content files imported in the completed batch.
   */
  public function getImportFiles() {
    return $this->importFiles;
  }

  /**
   * Gets the list of imported content entities.
   *
   * @return array
   *   An associative array of imported content entities keyed by file name.
   */
  public function getLoadedContent() {
    return $this->loadedContent;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EventBase::$contentLoader protected property The ContentLoader being actively executed and triggering the event.
EventBase::getContentLoader public function Gets the ContentLoader object that triggered the event.
PostImportEvent::$importFiles protected property The list of content files imported in the completed batch.
PostImportEvent::$loadedContent protected property An associative array of imported content entities keyed by file name.
PostImportEvent::getImportFiles public function Gets the list of files imported in the completed batch.
PostImportEvent::getLoadedContent public function Gets the list of imported content entities.
PostImportEvent::__construct public function Constructs a yaml content post-import event object. Overrides EventBase::__construct