class MigrateMapSaveEvent

Same name in other branches
  1. 8.9.x core/modules/migrate/src/Event/MigrateMapSaveEvent.php \Drupal\migrate\Event\MigrateMapSaveEvent
  2. 10 core/modules/migrate/src/Event/MigrateMapSaveEvent.php \Drupal\migrate\Event\MigrateMapSaveEvent
  3. 11.x core/modules/migrate/src/Event/MigrateMapSaveEvent.php \Drupal\migrate\Event\MigrateMapSaveEvent

Wraps a migrate map save event for event listeners.

Hierarchy

  • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
    • class \Drupal\migrate\Event\MigrateMapSaveEvent extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of MigrateMapSaveEvent

3 files declare their use of MigrateMapSaveEvent
MigrateEventsTest.php in core/modules/migrate/tests/src/Kernel/MigrateEventsTest.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/MigrateMapSaveEvent.php, line 11

Namespace

Drupal\migrate\Event
View source
class MigrateMapSaveEvent extends Event {
    
    /**
     * Map plugin.
     *
     * @var \Drupal\migrate\Plugin\MigrateIdMapInterface
     */
    protected $map;
    
    /**
     * Array of fields being saved to the map, keyed by field name.
     *
     * @var array
     */
    protected $fields;
    
    /**
     * Constructs a migration map event object.
     *
     * @param \Drupal\migrate\Plugin\MigrateIdMapInterface $map
     *   Map plugin.
     * @param array $fields
     *   Array of fields being saved to the map.
     */
    public function __construct(MigrateIdMapInterface $map, array $fields) {
        $this->map = $map;
        $this->fields = $fields;
    }
    
    /**
     * Gets the map plugin.
     *
     * @return \Drupal\migrate\Plugin\MigrateIdMapInterface
     *   The map plugin that caused the event to fire.
     */
    public function getMap() {
        return $this->map;
    }
    
    /**
     * Gets the fields about to be saved to the map.
     *
     * @return array
     *   Array of map fields, keyed by field name.
     */
    public function getFields() {
        return $this->fields;
    }

}

Members

Title Sort descending Modifiers Object type Summary
MigrateMapSaveEvent::$fields protected property Array of fields being saved to the map, keyed by field name.
MigrateMapSaveEvent::$map protected property Map plugin.
MigrateMapSaveEvent::getFields public function Gets the fields about to be saved to the map.
MigrateMapSaveEvent::getMap public function Gets the map plugin.
MigrateMapSaveEvent::__construct public function Constructs a migration map event object.

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