You are here

class DataImportEvent in YAML Content 8

Same name and namespace in other branches
  1. 8.2 src/Event/DataImportEvent.php \Drupal\yaml_content\Event\DataImportEvent

Wraps a yaml content data import event for event listeners.

Hierarchy

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

Expanded class hierarchy of DataImportEvent

File

src/Event/DataImportEvent.php, line 10

Namespace

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

  /**
   * The parsed content from the file used to create the entity.
   *
   * @var array
   */
  protected $contentData;

  /**
   * Constructs a yaml content entity pre-save event object.
   *
   * @param \Drupal\yaml_content\ContentLoader\ContentLoaderInterface $loader
   *   The active Content Loader that triggered the event.
   * @param array $content_data
   *   The parsed content loaded from the content file to be loaded into
   *   the entity field.
   */
  public function __construct(ContentLoaderInterface $loader, array $content_data) {
    parent::__construct($loader);
    $this->contentData = $content_data;
  }

  /**
   * Gets the parsed content to populate into the field.
   *
   * @return array
   *   The parsed content loaded from the content file to be loaded into
   *   the entity field.
   */
  public function getContentData() {
    return $this->contentData;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DataImportEvent::$contentData protected property The parsed content from the file used to create the entity.
DataImportEvent::getContentData public function Gets the parsed content to populate into the field.
DataImportEvent::__construct public function Constructs a yaml content entity pre-save event object. Overrides EventBase::__construct 2
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.