You are here

class MigrateIdMapMessageEvent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php \Drupal\migrate\Event\MigrateIdMapMessageEvent

Wraps an idmap message event for event listeners.

Hierarchy

Expanded class hierarchy of MigrateIdMapMessageEvent

2 files declare their use of MigrateIdMapMessageEvent
MigrateMessageTest.php in core/modules/migrate/src/Tests/MigrateMessageTest.php
Contains \Drupal\migrate\Tests\MigrateMessageTest.
Sql.php in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Contains \Drupal\migrate\Plugin\migrate\id_map\Sql.

File

core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php, line 16
Contains \Drupal\migrate\Event\MigrateIdMapMessageEvent.

Namespace

Drupal\migrate\Event
View source
class MigrateIdMapMessageEvent extends Event {

  /**
   * Migration entity.
   *
   * @var \Drupal\migrate\Entity\MigrationInterface
   */
  protected $migration;

  /**
   * Array of values uniquely identifying the source row.
   *
   * @var array
   */
  protected $sourceIdValues;

  /**
   * Message to be logged.
   *
   * @var string
   */
  protected $message;

  /**
   * Message severity.
   *
   * @var int
   */
  protected $level;

  /**
   * Constructs a post-save event object.
   *
   * @param \Drupal\migrate\Entity\MigrationInterface $migration
   *   Migration entity.
   * @param array $source_id_values
   *   Values represent the source ID.
   * @param string $message
   *   The message
   * @param int $level
   *   Severity level (one of the MigrationInterface::MESSAGE_* constants).
   */
  public function __construct(MigrationInterface $migration, array $source_id_values, $message, $level) {
    $this->migration = $migration;
    $this->sourceIdValues = $source_id_values;
    $this->message = $message;
    $this->level = $level;
  }

  /**
   * Gets the migration entity.
   *
   * @return \Drupal\migrate\Entity\MigrationInterface
   *   The migration entity involved.
   */
  public function getMigration() {
    return $this->migration;
  }

  /**
   * Gets the source ID values.
   *
   * @return array
   *   The source ID as an array.
   */
  public function getSourceIdValues() {
    return $this->sourceIdValues;
  }

  /**
   * Gets the message to be logged.
   *
   * @return string
   *   The message text.
   */
  public function getMessage() {
    return $this->message;
  }

  /**
   * Gets the severity level of the message (one of the
   * MigrationInterface::MESSAGE_* constants).
   *
   * @return int
   *   The message level.
   */
  public function getLevel() {
    return $this->level;
  }

}

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.
MigrateIdMapMessageEvent::$level protected property Message severity.
MigrateIdMapMessageEvent::$message protected property Message to be logged.
MigrateIdMapMessageEvent::$migration protected property Migration entity.
MigrateIdMapMessageEvent::$sourceIdValues protected property Array of values uniquely identifying the source row.
MigrateIdMapMessageEvent::getLevel public function Gets the severity level of the message (one of the MigrationInterface::MESSAGE_* constants).
MigrateIdMapMessageEvent::getMessage public function Gets the message to be logged.
MigrateIdMapMessageEvent::getMigration public function Gets the migration entity.
MigrateIdMapMessageEvent::getSourceIdValues public function Gets the source ID values.
MigrateIdMapMessageEvent::__construct public function Constructs a post-save event object.