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