public function prepareRow(Row
$row) { $result = TRUE;
try { $result_hook =
$this->
getModuleHandler()->
invokeAll('migrate_prepare_row',
[$row,
$this,
$this->migration
]);
$result_named_hook =
$this->
getModuleHandler()->
invokeAll('migrate_' .
$this->migration->
id() . '_prepare_row',
[$row,
$this,
$this->migration
]);
// We will skip if any hook returned FALSE.
$skip =
($result_hook &&
in_array(FALSE,
$result_hook)) || ($result_named_hook &&
in_array(FALSE,
$result_named_hook));
$save_to_map = TRUE;
} catch (MigrateSkipRowException
$e) { $skip = TRUE;
$save_to_map =
$e->
getSaveToMap();
if ($message =
trim($e->
getMessage())) { $this->idMap->
saveMessage($row->
getSourceIdValues(),
$message, MigrationInterface::MESSAGE_INFORMATIONAL
);
} } // We're explicitly skipping this row - keep track in the map table.
if ($skip) { // Make sure we replace any previous messages for this item with any
// new ones.
if ($save_to_map) { $this->idMap->
saveIdMapping($row,
[], MigrateIdMapInterface::STATUS_IGNORED
);