Mercurial > hg > isophonics-drupal-site
annotate core/modules/migrate/src/Event/MigrateMapDeleteEvent.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\migrate\Event; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\migrate\Plugin\MigrateIdMapInterface; |
Chris@0 | 6 use Symfony\Component\EventDispatcher\Event; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Wraps a migrate map delete event for event listeners. |
Chris@0 | 10 */ |
Chris@0 | 11 class MigrateMapDeleteEvent extends Event { |
Chris@0 | 12 |
Chris@0 | 13 /** |
Chris@0 | 14 * Map plugin. |
Chris@0 | 15 * |
Chris@0 | 16 * @var \Drupal\migrate\Plugin\MigrateIdMapInterface |
Chris@0 | 17 */ |
Chris@0 | 18 protected $map; |
Chris@0 | 19 |
Chris@0 | 20 /** |
Chris@0 | 21 * Array of source ID fields. |
Chris@0 | 22 * |
Chris@0 | 23 * @var array |
Chris@0 | 24 */ |
Chris@0 | 25 protected $sourceId; |
Chris@0 | 26 |
Chris@0 | 27 /** |
Chris@0 | 28 * Constructs a migration map delete event object. |
Chris@0 | 29 * |
Chris@0 | 30 * @param \Drupal\migrate\Plugin\MigrateIdMapInterface $map |
Chris@0 | 31 * Map plugin. |
Chris@0 | 32 * @param array $source_id |
Chris@0 | 33 * Array of source ID fields representing the object being deleted from the map. |
Chris@0 | 34 */ |
Chris@0 | 35 public function __construct(MigrateIdMapInterface $map, array $source_id) { |
Chris@0 | 36 $this->map = $map; |
Chris@0 | 37 $this->sourceId = $source_id; |
Chris@0 | 38 } |
Chris@0 | 39 |
Chris@0 | 40 /** |
Chris@0 | 41 * Gets the map plugin. |
Chris@0 | 42 * |
Chris@0 | 43 * @return \Drupal\migrate\Plugin\MigrateIdMapInterface |
Chris@0 | 44 * The map plugin that caused the event to fire. |
Chris@0 | 45 */ |
Chris@0 | 46 public function getMap() { |
Chris@0 | 47 return $this->map; |
Chris@0 | 48 } |
Chris@0 | 49 |
Chris@0 | 50 /** |
Chris@0 | 51 * Gets the source ID of the item being removed from the map. |
Chris@0 | 52 * |
Chris@0 | 53 * @return array |
Chris@0 | 54 * Array of source ID fields. |
Chris@0 | 55 */ |
Chris@0 | 56 public function getSourceId() { |
Chris@0 | 57 return $this->sourceId; |
Chris@0 | 58 } |
Chris@0 | 59 |
Chris@0 | 60 } |