3 namespace Drupal\migrate\Event;
5 use Drupal\migrate\Plugin\MigrationInterface;
6 use Drupal\migrate\MigrateMessageInterface;
7 use Symfony\Component\EventDispatcher\Event as SymfonyEvent;
9 class EventBase extends SymfonyEvent {
14 * @var \Drupal\migrate\Plugin\MigrationInterface
19 * The current message service.
21 * @var \Drupal\migrate\MigrateMessageInterface
26 * Constructs a Migrate event object.
28 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
29 * The migration being run.
30 * @param \Drupal\migrate\MigrateMessageInterface $message
31 * The Migrate message service.
33 public function __construct(MigrationInterface $migration, MigrateMessageInterface $message) {
34 $this->migration = $migration;
35 $this->message = $message;
41 * @return \Drupal\migrate\Plugin\MigrationInterface
42 * The migration being run.
44 public function getMigration() {
45 return $this->migration;
49 * Logs a message using the Migrate message service.
51 * @param string $message
54 * The type of message, for example: status or warning.
56 public function logMessage($message, $type = 'status') {
57 $this->message->display($message, $type);