getMigration(); $source = $migration->getSourcePlugin(); if ($source instanceof $plugin_interface) { call_user_func([$source, $method], $event); } $destination = $migration->getDestinationPlugin(); if ($destination instanceof $plugin_interface) { call_user_func([$destination, $method], $event); } } /** * Forwards pre-import events to the source and destination plugins. * * @param \Drupal\migrate\Event\MigrateImportEvent $event * The import event. */ public function preImport(MigrateImportEvent $event) { $this->invoke('preImport', $event, ImportAwareInterface::class); } /** * Forwards post-import events to the source and destination plugins. * * @param \Drupal\migrate\Event\MigrateImportEvent $event * The import event. */ public function postImport(MigrateImportEvent $event) { $this->invoke('postImport', $event, ImportAwareInterface::class); } /** * Forwards pre-rollback events to the source and destination plugins. * * @param \Drupal\migrate\Event\MigrateRollbackEvent $event * The rollback event. */ public function preRollback(MigrateRollbackEvent $event) { $this->invoke('preRollback', $event, RollbackAwareInterface::class); } /** * Forwards post-rollback events to the source and destination plugins. * * @param \Drupal\migrate\Event\MigrateRollbackEvent $event * The rollback event. */ public function postRollback(MigrateRollbackEvent $event) { $this->invoke('postRollback', $event, RollbackAwareInterface::class); } /** * {@inheritdoc} */ public static function getSubscribedEvents() { $events = []; $events[MigrateEvents::PRE_IMPORT][] = ['preImport']; $events[MigrateEvents::POST_IMPORT][] = ['postImport']; $events[MigrateEvents::PRE_ROLLBACK][] = ['preRollback']; $events[MigrateEvents::POST_ROLLBACK][] = ['postRollback']; return $events; } }