You are here

ExportEvent.php in Default Content for D8 2.0.x

Same filename and directory in other branches
  1. 8 src/Event/ExportEvent.php

File

src/Event/ExportEvent.php
View source
<?php

namespace Drupal\default_content\Event;

use Drupal\Core\Entity\ContentEntityInterface;
use Symfony\Component\EventDispatcher\Event;

/**
 * Defines event fired when content is exported.
 *
 * @see \Drupal\default_content\Event\DefaultContentEvents
 */
class ExportEvent extends Event {

  /**
   * The entity we're exporting.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface
   */
  protected $entity;

  /**
   * Constructs a new export event.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The exported content entity.
   */
  public function __construct(ContentEntityInterface $entity) {
    $this->entity = $entity;
  }

  /**
   * Get the entity we've exported.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   *   The exported content entity.
   */
  public function getExportedEntity() {
    return $this->entity;
  }

}

Classes

Namesort descending Description
ExportEvent Defines event fired when content is exported.