Ejemplo n.º 1
0
 /**
  * Reacts to map save event.
  *
  * @param \Drupal\Migrate\Event\MigrateMapSaveEvent $event
  *   The migration event.
  * @param string $name
  *   The event name.
  */
 public function mapSaveEventRecorder(MigrateMapSaveEvent $event, $name)
 {
     $this->state->set('migrate_events_test.map_save_event', array('event_name' => $name, 'map' => $event->getMap(), 'fields' => $event->getFields()));
 }
 /**
  * Count up any map save events.
  *
  * @param \Drupal\migrate\Event\MigrateMapSaveEvent $event
  *   The map event.
  */
 public function onMapSave(MigrateMapSaveEvent $event)
 {
     $fields = $event->getFields();
     // Distinguish between creation and update.
     if ($fields['source_row_status'] == MigrateIdMapInterface::STATUS_IMPORTED && $this->preExistingItem) {
         $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]++;
     } else {
         $this->saveCounters[$fields['source_row_status']]++;
     }
 }