Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/migrate/src/Event/MigrateIdMapMessageEvent.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\migrate\Event; | |
4 | |
5 use Drupal\migrate\Plugin\MigrationInterface; | |
6 use Symfony\Component\EventDispatcher\Event; | |
7 | |
8 /** | |
9 * Wraps an idmap message event for event listeners. | |
10 */ | |
11 class MigrateIdMapMessageEvent extends Event { | |
12 | |
13 /** | |
14 * Migration entity. | |
15 * | |
16 * @var \Drupal\migrate\Plugin\MigrationInterface | |
17 */ | |
18 protected $migration; | |
19 | |
20 /** | |
21 * Array of values uniquely identifying the source row. | |
22 * | |
23 * @var array | |
24 */ | |
25 protected $sourceIdValues; | |
26 | |
27 /** | |
28 * Message to be logged. | |
29 * | |
30 * @var string | |
31 */ | |
32 protected $message; | |
33 | |
34 /** | |
35 * Message severity. | |
36 * | |
37 * @var int | |
38 */ | |
39 protected $level; | |
40 | |
41 /** | |
42 * Constructs a post-save event object. | |
43 * | |
44 * @param \Drupal\migrate\Plugin\MigrationInterface $migration | |
45 * Migration entity. | |
46 * @param array $source_id_values | |
47 * Values represent the source ID. | |
48 * @param string $message | |
49 * The message | |
50 * @param int $level | |
51 * Severity level (one of the MigrationInterface::MESSAGE_* constants). | |
52 */ | |
53 public function __construct(MigrationInterface $migration, array $source_id_values, $message, $level) { | |
54 $this->migration = $migration; | |
55 $this->sourceIdValues = $source_id_values; | |
56 $this->message = $message; | |
57 $this->level = $level; | |
58 } | |
59 | |
60 /** | |
61 * Gets the migration entity. | |
62 * | |
63 * @return \Drupal\migrate\Plugin\MigrationInterface | |
64 * The migration entity involved. | |
65 */ | |
66 public function getMigration() { | |
67 return $this->migration; | |
68 } | |
69 | |
70 /** | |
71 * Gets the source ID values. | |
72 * | |
73 * @return array | |
74 * The source ID as an array. | |
75 */ | |
76 public function getSourceIdValues() { | |
77 return $this->sourceIdValues; | |
78 } | |
79 | |
80 /** | |
81 * Gets the message to be logged. | |
82 * | |
83 * @return string | |
84 * The message text. | |
85 */ | |
86 public function getMessage() { | |
87 return $this->message; | |
88 } | |
89 | |
90 /** | |
91 * Gets the severity level of the message (one of the | |
92 * MigrationInterface::MESSAGE_* constants). | |
93 * | |
94 * @return int | |
95 * The message level. | |
96 */ | |
97 public function getLevel() { | |
98 return $this->level; | |
99 } | |
100 | |
101 } |