Mercurial > hg > isophonics-drupal-site
comparison modules/contrib/migrate_plus/src/Event/MigratePrepareRowEvent.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_plus\Event; | |
4 | |
5 use Drupal\migrate\Plugin\MigrationInterface; | |
6 use Drupal\migrate\Plugin\MigrateSourceInterface; | |
7 use Drupal\migrate\Row; | |
8 use Symfony\Component\EventDispatcher\Event; | |
9 | |
10 /** | |
11 * Wraps a prepare-row event for event listeners. | |
12 */ | |
13 class MigratePrepareRowEvent extends Event { | |
14 | |
15 /** | |
16 * Row object. | |
17 * | |
18 * @var \Drupal\migrate\Row | |
19 */ | |
20 protected $row; | |
21 | |
22 /** | |
23 * Migration source plugin. | |
24 * | |
25 * @var \Drupal\migrate\Plugin\MigrateSourceInterface | |
26 */ | |
27 protected $source; | |
28 | |
29 /** | |
30 * Migration plugin. | |
31 * | |
32 * @var \Drupal\migrate\Plugin\MigrationInterface | |
33 */ | |
34 protected $migration; | |
35 | |
36 /** | |
37 * Constructs a prepare-row event object. | |
38 * | |
39 * @param \Drupal\migrate\Row $row | |
40 * Row of source data to be analyzed/manipulated. | |
41 * | |
42 * @param \Drupal\migrate\Plugin\MigrateSourceInterface $source | |
43 * Source plugin that is the source of the event. | |
44 * | |
45 * @param \Drupal\migrate\Plugin\MigrationInterface $migration | |
46 * Migration entity. | |
47 */ | |
48 public function __construct(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { | |
49 $this->row = $row; | |
50 $this->source = $source; | |
51 $this->migration = $migration; | |
52 } | |
53 | |
54 /** | |
55 * Gets the row object. | |
56 * | |
57 * @return \Drupal\migrate\Row | |
58 * The row object about to be imported. | |
59 */ | |
60 public function getRow() { | |
61 return $this->row; | |
62 } | |
63 | |
64 /** | |
65 * Gets the source plugin. | |
66 * | |
67 * @return \Drupal\migrate\Plugin\MigrateSourceInterface $source | |
68 * The source plugin firing the event. | |
69 */ | |
70 public function getSource() { | |
71 return $this->source; | |
72 } | |
73 | |
74 /** | |
75 * Gets the migration plugin. | |
76 * | |
77 * @return \Drupal\migrate\Plugin\MigrationInterface | |
78 * The migration entity being imported. | |
79 */ | |
80 public function getMigration() { | |
81 return $this->migration; | |
82 } | |
83 | |
84 } |