comparison core/modules/migrate/src/Event/MigrateMapSaveEvent.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\migrate\Event;
4
5 use Drupal\migrate\Plugin\MigrateIdMapInterface;
6 use Symfony\Component\EventDispatcher\Event;
7
8 /**
9 * Wraps a migrate map save event for event listeners.
10 */
11 class MigrateMapSaveEvent extends Event {
12
13 /**
14 * Map plugin.
15 *
16 * @var \Drupal\migrate\Plugin\MigrateIdMapInterface
17 */
18 protected $map;
19
20 /**
21 * Array of fields being saved to the map, keyed by field name.
22 *
23 * @var array
24 */
25 protected $fields;
26
27 /**
28 * Constructs a migration map event object.
29 *
30 * @param \Drupal\migrate\Plugin\MigrateIdMapInterface $map
31 * Map plugin.
32 * @param array $fields
33 * Array of fields being saved to the map.
34 */
35 public function __construct(MigrateIdMapInterface $map, array $fields) {
36 $this->map = $map;
37 $this->fields = $fields;
38 }
39
40 /**
41 * Gets the map plugin.
42 *
43 * @return \Drupal\migrate\Plugin\MigrateIdMapInterface
44 * The map plugin that caused the event to fire.
45 */
46 public function getMap() {
47 return $this->map;
48 }
49
50 /**
51 * Gets the fields about to be saved to the map.
52 *
53 * @return array
54 * Array of map fields, keyed by field name.
55 */
56 public function getFields() {
57 return $this->fields;
58 }
59
60 }