You are here

public function EntitySearchPage::import in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php \Drupal\search\Plugin\migrate\destination\EntitySearchPage::import()

Import the row.

Derived classes must implement import(), to construct one new object (pre-populated) using ID mappings in the Migration.

Parameters

\Drupal\migrate\Row $row: The row object.

array $old_destination_id_values: (optional) The old destination IDs. Defaults to an empty array.

Return value

array|bool An indexed array of destination IDs in the same order as defined in the plugin's getIds() method if the plugin wants to save the IDs to the ID map, TRUE to indicate success without saving IDs to the ID map, or FALSE to indicate a failure.

Overrides EntityConfigBase::import

File

core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php, line 82

Class

EntitySearchPage
Migrate destination for search page.

Namespace

Drupal\search\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {

  // The search page settings may be for a module not enabled on the
  // destination so make sure it is enabled for updating search page settings.
  if ($this->moduleHandler
    ->moduleExists($row
    ->getDestinationProperty('module'))) {
    return parent::import($row, $old_destination_id_values);
  }
  $msg = sprintf("Search module '%s' is not enabled on this site.", $row
    ->getDestinationProperty('module'));
  throw new MigrateException($msg, 0, NULL, MigrationInterface::MESSAGE_INFORMATIONAL, MigrateIdMapInterface::STATUS_IGNORED);
}