You are here

class MigratePrepareRowEvent in Migrate Plus 8.2

Same name and namespace in other branches
  1. 8.5 src/Event/MigratePrepareRowEvent.php \Drupal\migrate_plus\Event\MigratePrepareRowEvent
  2. 8 src/Event/MigratePrepareRowEvent.php \Drupal\migrate_plus\Event\MigratePrepareRowEvent
  3. 8.3 src/Event/MigratePrepareRowEvent.php \Drupal\migrate_plus\Event\MigratePrepareRowEvent
  4. 8.4 src/Event/MigratePrepareRowEvent.php \Drupal\migrate_plus\Event\MigratePrepareRowEvent

Wraps a prepare-row event for event listeners.

Hierarchy

Expanded class hierarchy of MigratePrepareRowEvent

1 file declares its use of MigratePrepareRowEvent
migrate_plus.module in ./migrate_plus.module
Provides enhancements for implementing and managing migrations.

File

src/Event/MigratePrepareRowEvent.php, line 13

Namespace

Drupal\migrate_plus\Event
View source
class MigratePrepareRowEvent extends Event {

  /**
   * Row object.
   *
   * @var \Drupal\migrate\Row
   */
  protected $row;

  /**
   * Migration source plugin.
   *
   * @var \Drupal\migrate\Plugin\MigrateSourceInterface
   */
  protected $source;

  /**
   * Migration plugin.
   *
   * @var \Drupal\migrate\Plugin\MigrationInterface
   */
  protected $migration;

  /**
   * Constructs a prepare-row event object.
   *
   * @param \Drupal\migrate\Row $row
   *   Row of source data to be analyzed/manipulated.
   *
   * @param \Drupal\migrate\Plugin\MigrateSourceInterface $source
   *   Source plugin that is the source of the event.
   *
   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   *   Migration entity.
   */
  public function __construct(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
    $this->row = $row;
    $this->source = $source;
    $this->migration = $migration;
  }

  /**
   * Gets the row object.
   *
   * @return \Drupal\migrate\Row
   *   The row object about to be imported.
   */
  public function getRow() {
    return $this->row;
  }

  /**
   * Gets the source plugin.
   *
   * @return \Drupal\migrate\Plugin\MigrateSourceInterface $source
   *   The source plugin firing the event.
   */
  public function getSource() {
    return $this->source;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
MigratePrepareRowEvent::$migration protected property Migration plugin.
MigratePrepareRowEvent::$row protected property Row object.
MigratePrepareRowEvent::$source protected property Migration source plugin.
MigratePrepareRowEvent::getMigration public function Gets the migration plugin.
MigratePrepareRowEvent::getRow public function Gets the row object.
MigratePrepareRowEvent::getSource public function Gets the source plugin.
MigratePrepareRowEvent::__construct public function Constructs a prepare-row event object.