class MigrateIdMapMessageEvent

Same name and namespace in other branches
  1. 11.x core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php \Drupal\migrate\Event\MigrateIdMapMessageEvent
  2. 10 core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php \Drupal\migrate\Event\MigrateIdMapMessageEvent
  3. 9 core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php \Drupal\migrate\Event\MigrateIdMapMessageEvent
  4. 8.9.x core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php \Drupal\migrate\Event\MigrateIdMapMessageEvent

Wraps an ID map message event for event listeners.

Hierarchy

Expanded class hierarchy of MigrateIdMapMessageEvent

4 files declare their use of MigrateIdMapMessageEvent
MigrateEntityContentValidationTest.php in core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
MigrateMessageTest.php in core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php
MigrateUpgradeImportBatch.php in core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
Sql.php in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php

File

core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php, line 11

Namespace

Drupal\migrate\Event
View source
class MigrateIdMapMessageEvent extends Event {
  
  /**
   * Constructs a post-save event object.
   *
   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   *   Migration entity.
   * @param array $sourceIdValues
   *   Values represent the source ID.
   * @param string $message
   *   The message.
   * @param int $level
   *   Severity level (one of the MigrationInterface::MESSAGE_* constants).
   */
  public function __construct(protected MigrationInterface $migration, protected array $sourceIdValues, protected $message, protected $level) {
  }
  
  /**
   * Gets the migration entity.
   *
   * @return \Drupal\migrate\Plugin\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.
   *
   * Message levels are declared in MigrationInterface and start with MESSAGE_.
   *
   * @see \Drupal\migrate\Plugin\MigrationInterface
   *
   * @return int
   *   The message level.
   */
  public function getLevel() {
    return $this->level;
  }

}

Members

Title Sort descending Modifiers Object type Summary
MigrateIdMapMessageEvent::getLevel public function Gets the severity level of the message.
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.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.